OSDN Git Service

finalize changelog
[jnethack/source.git] / src / polyself.c
1 /* NetHack 3.6  polyself.c      $NHDT-Date: 1448496566 2015/11/26 00:09:26 $  $NHDT-Branch: master $:$NHDT-Revision: 1.104 $ */
2 /*      Copyright (C) 1987, 1988, 1989 by Ken Arromdee */
3 /* NetHack may be freely redistributed.  See license for details. */
4
5 /* JNetHack Copyright */
6 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000  */
7 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2016            */
8 /* JNetHack may be freely redistributed.  See license for details. */
9
10 /*
11  * Polymorph self routine.
12  *
13  * Note:  the light source handling code assumes that both youmonst.m_id
14  * and youmonst.mx will always remain 0 when it handles the case of the
15  * player polymorphed into a light-emitting monster.
16  *
17  * Transformation sequences:
18  *              /-> polymon                 poly into monster form
19  *    polyself =
20  *              \-> newman -> polyman       fail to poly, get human form
21  *
22  *    rehumanize -> polyman                 return to original form
23  *
24  *    polymon (called directly)             usually golem petrification
25  */
26
27 #include "hack.h"
28
29 STATIC_DCL void FDECL(check_strangling, (BOOLEAN_P));
30 STATIC_DCL void FDECL(polyman, (const char *, const char *));
31 STATIC_DCL void NDECL(break_armor);
32 STATIC_DCL void FDECL(drop_weapon, (int));
33 STATIC_DCL void NDECL(uunstick);
34 STATIC_DCL int FDECL(armor_to_dragon, (int));
35 STATIC_DCL void NDECL(newman);
36 STATIC_DCL boolean FDECL(polysense, (struct permonst *));
37
38 STATIC_VAR const char no_longer_petrify_resistant[] =
39 /*JP
40     "No longer petrify-resistant, you";
41 */
42     "\90Î\89»\82Ö\82Ì\92ï\8dR\97Í\82ª\82È\82­\82È\82Á\82Ä\81C\82 \82È\82½\82Í";
43
44 /* controls whether taking on new form or becoming new man can also
45    change sex (ought to be an arg to polymon() and newman() instead) */
46 STATIC_VAR int sex_change_ok = 0;
47
48 /* update the youmonst.data structure pointer and intrinsics */
49 void
50 set_uasmon()
51 {
52     struct permonst *mdat = &mons[u.umonnum];
53
54     set_mon_data(&youmonst, mdat, 0);
55
56 #define PROPSET(PropIndx, ON)                          \
57     do {                                               \
58         if (ON)                                        \
59             u.uprops[PropIndx].intrinsic |= FROMFORM;  \
60         else                                           \
61             u.uprops[PropIndx].intrinsic &= ~FROMFORM; \
62     } while (0)
63
64     PROPSET(FIRE_RES, resists_fire(&youmonst));
65     PROPSET(COLD_RES, resists_cold(&youmonst));
66     PROPSET(SLEEP_RES, resists_sleep(&youmonst));
67     PROPSET(DISINT_RES, resists_disint(&youmonst));
68     PROPSET(SHOCK_RES, resists_elec(&youmonst));
69     PROPSET(POISON_RES, resists_poison(&youmonst));
70     PROPSET(ACID_RES, resists_acid(&youmonst));
71     PROPSET(STONE_RES, resists_ston(&youmonst));
72     {
73         /* resists_drli() takes wielded weapon into account; suppress it */
74         struct obj *save_uwep = uwep;
75
76         uwep = 0;
77         PROPSET(DRAIN_RES, resists_drli(&youmonst));
78         uwep = save_uwep;
79     }
80     /* resists_magm() takes wielded, worn, and carried equipment into
81        into account; cheat and duplicate its monster-specific part */
82     PROPSET(ANTIMAGIC, (dmgtype(mdat, AD_MAGM)
83                         || mdat == &mons[PM_BABY_GRAY_DRAGON]
84                         || dmgtype(mdat, AD_RBRE)));
85     PROPSET(SICK_RES, (mdat->mlet == S_FUNGUS || mdat == &mons[PM_GHOUL]));
86
87     PROPSET(STUNNED, (mdat == &mons[PM_STALKER] || is_bat(mdat)));
88     PROPSET(HALLUC_RES, dmgtype(mdat, AD_HALU));
89     PROPSET(SEE_INVIS, perceives(mdat));
90     PROPSET(TELEPAT, telepathic(mdat));
91     PROPSET(INFRAVISION, infravision(mdat));
92     PROPSET(INVIS, pm_invisible(mdat));
93     PROPSET(TELEPORT, can_teleport(mdat));
94     PROPSET(TELEPORT_CONTROL, control_teleport(mdat));
95     PROPSET(LEVITATION, is_floater(mdat));
96     PROPSET(FLYING, is_flyer(mdat));
97     PROPSET(SWIMMING, is_swimmer(mdat));
98     /* [don't touch MAGICAL_BREATHING here; both Amphibious and Breathless
99        key off of it but include different monster forms...] */
100     PROPSET(PASSES_WALLS, passes_walls(mdat));
101     PROPSET(REGENERATION, regenerates(mdat));
102     PROPSET(REFLECTING, (mdat == &mons[PM_SILVER_DRAGON]));
103
104     float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
105
106 #undef PROPSET
107
108 #ifdef STATUS_VIA_WINDOWPORT
109     status_initialize(REASSESS_ONLY);
110 #endif
111 }
112
113 /* Levitation overrides Flying; set or clear BFlying|I_SPECIAL */
114 void
115 float_vs_flight()
116 {
117     /* floating overrides flight; normally float_up() and float_down()
118        handle this, but sometimes they're skipped */
119     if (HLevitation || ELevitation)
120         BFlying |= I_SPECIAL;
121     else
122         BFlying &= ~I_SPECIAL;
123 }
124
125 /* for changing into form that's immune to strangulation */
126 STATIC_OVL void
127 check_strangling(on)
128 boolean on;
129 {
130     /* on -- maybe resume strangling */
131     if (on) {
132         /* when Strangled is already set, polymorphing from one
133            vulnerable form into another causes the counter to be reset */
134         if (uamul && uamul->otyp == AMULET_OF_STRANGULATION
135             && can_be_strangled(&youmonst)) {
136 #if 0 /*JP*/
137             Your("%s %s your %s!", simpleonames(uamul),
138                  Strangled ? "still constricts" : "begins constricting",
139                  body_part(NECK)); /* "throat" */
140 #else
141             Your("%s%s%s\82ð\8di\82ß%s\81I", simpleonames(uamul),
142                  Strangled ? "\82Í\82Ü\82¾" : "\82ª",
143                  body_part(NECK),
144                  Strangled ? "\82Ä\82¢\82é" : "\82Í\82\82ß\82½");
145 #endif
146             Strangled = 6L;
147             makeknown(AMULET_OF_STRANGULATION);
148         }
149
150     /* off -- maybe block strangling */
151     } else {
152         if (Strangled && !can_be_strangled(&youmonst)) {
153             Strangled = 0L;
154 /*JP
155             You("are no longer being strangled.");
156 */
157             You("\82à\82Í\82â\92\82\91§\82µ\82Ä\82¢\82È\82¢\81D");
158         }
159     }
160 }
161
162 /* make a (new) human out of the player */
163 STATIC_OVL void
164 polyman(fmt, arg)
165 const char *fmt, *arg;
166 {
167     boolean sticky = (sticks(youmonst.data) && u.ustuck && !u.uswallow),
168             was_mimicking = (youmonst.m_ap_type == M_AP_OBJECT);
169     boolean was_blind = !!Blind;
170
171     if (Upolyd) {
172         u.acurr = u.macurr; /* restore old attribs */
173         u.amax = u.mamax;
174         u.umonnum = u.umonster;
175         flags.female = u.mfemale;
176     }
177     set_uasmon();
178
179     u.mh = u.mhmax = 0;
180     u.mtimedone = 0;
181     skinback(FALSE);
182     u.uundetected = 0;
183
184     if (sticky)
185         uunstick();
186     find_ac();
187     if (was_mimicking) {
188         if (multi < 0)
189             unmul("");
190         youmonst.m_ap_type = M_AP_NOTHING;
191     }
192
193     newsym(u.ux, u.uy);
194
195     You(fmt, arg);
196     /* check whether player foolishly genocided self while poly'd */
197     if ((mvitals[urole.malenum].mvflags & G_GENOD)
198         || (urole.femalenum != NON_PM
199             && (mvitals[urole.femalenum].mvflags & G_GENOD))
200         || (mvitals[urace.malenum].mvflags & G_GENOD)
201         || (urace.femalenum != NON_PM
202             && (mvitals[urace.femalenum].mvflags & G_GENOD))) {
203         /* intervening activity might have clobbered genocide info */
204         struct kinfo *kptr = find_delayed_killer(POLYMORPH);
205
206         if (kptr != (struct kinfo *) 0 && kptr->name[0]) {
207             killer.format = kptr->format;
208             Strcpy(killer.name, kptr->name);
209         } else {
210             killer.format = KILLED_BY;
211 /*JP
212             Strcpy(killer.name, "self-genocide");
213 */
214             Strcpy(killer.name, "\8e©\8bs\93I\8bs\8eE\82Å");
215         }
216         dealloc_killer(kptr);
217         done(GENOCIDED);
218     }
219
220     if (u.twoweap && !could_twoweap(youmonst.data))
221         untwoweapon();
222
223     if (u.utraptype == TT_PIT && u.utrap) {
224         u.utrap = rn1(6, 2); /* time to escape resets */
225     }
226     if (was_blind && !Blind) { /* reverting from eyeless */
227         Blinded = 1L;
228         make_blinded(0L, TRUE); /* remove blindness */
229     }
230     check_strangling(TRUE);
231
232     if (!Levitation && !u.ustuck && is_pool_or_lava(u.ux, u.uy))
233         spoteffects(TRUE);
234
235     see_monsters();
236 }
237
238 void
239 change_sex()
240 {
241     /* setting u.umonster for caveman/cavewoman or priest/priestess
242        swap unintentionally makes `Upolyd' appear to be true */
243     boolean already_polyd = (boolean) Upolyd;
244
245     /* Some monsters are always of one sex and their sex can't be changed;
246      * Succubi/incubi can change, but are handled below.
247      *
248      * !already_polyd check necessary because is_male() and is_female()
249      * are true if the player is a priest/priestess.
250      */
251     if (!already_polyd
252         || (!is_male(youmonst.data) && !is_female(youmonst.data)
253             && !is_neuter(youmonst.data)))
254         flags.female = !flags.female;
255     if (already_polyd) /* poly'd: also change saved sex */
256         u.mfemale = !u.mfemale;
257     max_rank_sz(); /* [this appears to be superfluous] */
258     if ((already_polyd ? u.mfemale : flags.female) && urole.name.f)
259         Strcpy(pl_character, urole.name.f);
260     else
261         Strcpy(pl_character, urole.name.m);
262     u.umonster = ((already_polyd ? u.mfemale : flags.female)
263                   && urole.femalenum != NON_PM)
264                      ? urole.femalenum
265                      : urole.malenum;
266     if (!already_polyd) {
267         u.umonnum = u.umonster;
268     } else if (u.umonnum == PM_SUCCUBUS || u.umonnum == PM_INCUBUS) {
269         flags.female = !flags.female;
270         /* change monster type to match new sex */
271         u.umonnum = (u.umonnum == PM_SUCCUBUS) ? PM_INCUBUS : PM_SUCCUBUS;
272         set_uasmon();
273     }
274 }
275
276 STATIC_OVL void
277 newman()
278 {
279     int i, oldlvl, newlvl, hpmax, enmax;
280
281     oldlvl = u.ulevel;
282     newlvl = oldlvl + rn1(5, -2);     /* new = old + {-2,-1,0,+1,+2} */
283     if (newlvl > 127 || newlvl < 1) { /* level went below 0? */
284         goto dead; /* old level is still intact (in case of lifesaving) */
285     }
286     if (newlvl > MAXULEV)
287         newlvl = MAXULEV;
288     /* If your level goes down, your peak level goes down by
289        the same amount so that you can't simply use blessed
290        full healing to undo the decrease.  But if your level
291        goes up, your peak level does *not* undergo the same
292        adjustment; you might end up losing out on the chance
293        to regain some levels previously lost to other causes. */
294     if (newlvl < oldlvl)
295         u.ulevelmax -= (oldlvl - newlvl);
296     if (u.ulevelmax < newlvl)
297         u.ulevelmax = newlvl;
298     u.ulevel = newlvl;
299
300     if (sex_change_ok && !rn2(10))
301         change_sex();
302
303     adjabil(oldlvl, (int) u.ulevel);
304     reset_rndmonst(NON_PM); /* new monster generation criteria */
305
306     /* random experience points for the new experience level */
307     u.uexp = rndexp(FALSE);
308
309     /* set up new attribute points (particularly Con) */
310     redist_attr();
311
312     /*
313      * New hit points:
314      *  remove level-gain based HP from any extra HP accumulated
315      *  (the "extra" might actually be negative);
316      *  modify the extra, retaining {80%, 90%, 100%, or 110%};
317      *  add in newly generated set of level-gain HP.
318      *
319      * (This used to calculate new HP in direct proportion to old HP,
320      * but that was subject to abuse:  accumulate a large amount of
321      * extra HP, drain level down to 1, then polyself to level 2 or 3
322      * [lifesaving capability needed to handle level 0 and -1 cases]
323      * and the extra got multiplied by 2 or 3.  Repeat the level
324      * drain and polyself steps until out of lifesaving capability.)
325      */
326     hpmax = u.uhpmax;
327     for (i = 0; i < oldlvl; i++)
328         hpmax -= (int) u.uhpinc[i];
329     /* hpmax * rn1(4,8) / 10; 0.95*hpmax on average */
330     hpmax = rounddiv((long) hpmax * (long) rn1(4, 8), 10);
331     for (i = 0; (u.ulevel = i) < newlvl; i++)
332         hpmax += newhp();
333     if (hpmax < u.ulevel)
334         hpmax = u.ulevel; /* min of 1 HP per level */
335     /* retain same proportion for current HP; u.uhp * hpmax / u.uhpmax */
336     u.uhp = rounddiv((long) u.uhp * (long) hpmax, u.uhpmax);
337     u.uhpmax = hpmax;
338     /*
339      * Do the same for spell power.
340      */
341     enmax = u.uenmax;
342     for (i = 0; i < oldlvl; i++)
343         enmax -= (int) u.ueninc[i];
344     enmax = rounddiv((long) enmax * (long) rn1(4, 8), 10);
345     for (i = 0; (u.ulevel = i) < newlvl; i++)
346         enmax += newpw();
347     if (enmax < u.ulevel)
348         enmax = u.ulevel;
349     u.uen = rounddiv((long) u.uen * (long) enmax,
350                      ((u.uenmax < 1) ? 1 : u.uenmax));
351     u.uenmax = enmax;
352     /* [should alignment record be tweaked too?] */
353
354     u.uhunger = rn1(500, 500);
355     if (Sick)
356         make_sick(0L, (char *) 0, FALSE, SICK_ALL);
357     if (Stoned)
358         make_stoned(0L, (char *) 0, 0, (char *) 0);
359     if (u.uhp <= 0) {
360         if (Polymorph_control) { /* even when Stunned || Unaware */
361             if (u.uhp <= 0)
362                 u.uhp = 1;
363         } else {
364         dead: /* we come directly here if their experience level went to 0 or
365                  less */
366 /*JP
367             Your("new form doesn't seem healthy enough to survive.");
368 */
369             Your("\90V\82µ\82¢\8ep\82Í\90\82«\82Ä\82¢\82­\82¾\82¯\82Ì\97Í\82ª\82È\82¢\82æ\82¤\82¾\81D");
370             killer.format = KILLED_BY_AN;
371 /*JP
372             Strcpy(killer.name, "unsuccessful polymorph");
373 */
374             Strcpy(killer.name, "\95Ï\89»\82Ì\8e¸\94s\82Å");
375             done(DIED);
376             newuhs(FALSE);
377             (void) polysense(youmonst.data);
378             return; /* lifesaved */
379         }
380     }
381     newuhs(FALSE);
382 /*JP
383     polyman("feel like a new %s!",
384 */
385     polyman("%s\82Æ\82µ\82Ä\90\82Ü\82ê\82©\82í\82Á\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81I",
386             /* use saved gender we're about to revert to, not current */
387             (u.mfemale && urace.individual.f)
388                 ? urace.individual.f
389                 : (urace.individual.m) ? urace.individual.m : urace.noun);
390     if (Slimed) {
391 /*JP
392         Your("body transforms, but there is still slime on you.");
393 */
394         Your("\91Ì\82Í\95Ï\89»\82µ\82½\82ª\81C\83X\83\89\83C\83\80\82ª\82Â\82¢\82½\82Ü\82Ü\82¾\81D");
395         make_slimed(10L, (const char *) 0);
396     }
397
398     (void) polysense(youmonst.data);
399     context.botl = 1;
400     see_monsters();
401     (void) encumber_msg();
402
403     retouch_equipment(2);
404     if (!uarmg)
405         selftouch(no_longer_petrify_resistant);
406 }
407
408 void
409 polyself(psflags)
410 int psflags;
411 {
412     char buf[BUFSZ];
413     int old_light, new_light, mntmp, class, tryct;
414     boolean forcecontrol = (psflags == 1), monsterpoly = (psflags == 2),
415             draconian = (uarm && Is_dragon_armor(uarm)),
416             iswere = (u.ulycn >= LOW_PM), isvamp = is_vampire(youmonst.data),
417             controllable_poly = Polymorph_control && !(Stunned || Unaware);
418
419     if (Unchanging) {
420 /*JP
421         pline("You fail to transform!");
422 */
423         pline("\82 \82È\82½\82Í\95Ï\89»\82É\8e¸\94s\82µ\82½\81I");
424         return;
425     }
426     /* being Stunned|Unaware doesn't negate this aspect of Poly_control */
427     if (!Polymorph_control && !forcecontrol && !draconian && !iswere
428         && !isvamp) {
429         if (rn2(20) > ACURR(A_CON)) {
430             You1(shudder_for_moment);
431 /*JP
432             losehp(rnd(30), "system shock", KILLED_BY_AN);
433 */
434             losehp(rnd(30), "\83V\83X\83e\83\80\83V\83\87\83b\83N\82Å", KILLED_BY_AN);
435             exercise(A_CON, FALSE);
436             return;
437         }
438     }
439     old_light = emits_light(youmonst.data);
440     mntmp = NON_PM;
441
442     if (monsterpoly && isvamp)
443         goto do_vampyr;
444
445     if (controllable_poly || forcecontrol) {
446         tryct = 5;
447         do {
448             mntmp = NON_PM;
449 /*JP
450             getlin("Become what kind of monster? [type the name]", buf);
451 */
452             getlin("\82Ç\82Ì\8eí\82Ì\89ö\95¨\82É\82È\82é\81H[\96¼\91O\82ð\93ü\82ê\82Ä\82Ë]", buf);
453             (void) mungspaces(buf);
454             if (*buf == '\033') {
455                 /* user is cancelling controlled poly */
456                 if (forcecontrol) { /* wizard mode #polyself */
457                     pline1(Never_mind);
458                     return;
459                 }
460                 Strcpy(buf, "*"); /* resort to random */
461             }
462             if (!strcmp(buf, "*") || !strcmp(buf, "random")) {
463                 /* explicitly requesting random result */
464                 tryct = 0; /* will skip thats_enough_tries */
465                 continue;  /* end do-while(--tryct > 0) loop */
466             }
467             class = 0;
468             mntmp = name_to_mon(buf);
469             if (mntmp < LOW_PM) {
470             by_class:
471                 class = name_to_monclass(buf, &mntmp);
472                 if (class && mntmp == NON_PM)
473                     mntmp = mkclass_poly(class);
474             }
475             if (mntmp < LOW_PM) {
476                 if (!class)
477 /*JP
478                     pline("I've never heard of such monsters.");
479 */
480                     pline("\82»\82ñ\82È\89ö\95¨\82Í\95·\82¢\82½\82±\82Æ\82ª\82È\82¢\81D");
481                 else
482 /*JP
483                     You_cant("polymorph into any of those.");
484 */
485                     pline("\82»\82ê\82É\82È\82é\82±\82Æ\82Í\82Å\82«\82È\82¢\81D");
486             } else if (iswere && (were_beastie(mntmp) == u.ulycn
487                                   || mntmp == counter_were(u.ulycn)
488                                   || (Upolyd && mntmp == PM_HUMAN))) {
489                 goto do_shift;
490                 /* Note:  humans are illegal as monsters, but an
491                  * illegal monster forces newman(), which is what we
492                  * want if they specified a human.... */
493             } else if (!polyok(&mons[mntmp])
494                        && !(mntmp == PM_HUMAN || your_race(&mons[mntmp])
495                             || mntmp == urole.malenum
496                             || mntmp == urole.femalenum)) {
497                 const char *pm_name;
498
499                 /* mkclass_poly() can pick a !polyok()
500                    candidate; if so, usually try again */
501                 if (class) {
502                     if (rn2(3) || --tryct > 0)
503                         goto by_class;
504                     /* no retries left; put one back on counter
505                        so that end of loop decrement will yield
506                        0 and trigger thats_enough_tries message */
507                     ++tryct;
508                 }
509                 pm_name = mons[mntmp].mname;
510                 if (the_unique_pm(&mons[mntmp]))
511                     pm_name = the(pm_name);
512                 else if (!type_is_pname(&mons[mntmp]))
513                     pm_name = an(pm_name);
514 /*JP
515                 You_cant("polymorph into %s.", pm_name);
516 */
517                 You_cant("%s\82É\95Ï\89»\82Å\82«\82È\82¢\81D", pm_name);
518             } else
519                 break;
520         } while (--tryct > 0);
521         if (!tryct)
522             pline1(thats_enough_tries);
523         /* allow skin merging, even when polymorph is controlled */
524         if (draconian && (tryct <= 0 || mntmp == armor_to_dragon(uarm->otyp)))
525             goto do_merge;
526         if (isvamp && (tryct <= 0 || mntmp == PM_WOLF || mntmp == PM_FOG_CLOUD
527                        || is_bat(&mons[mntmp])))
528             goto do_vampyr;
529     } else if (draconian || iswere || isvamp) {
530         /* special changes that don't require polyok() */
531         if (draconian) {
532         do_merge:
533             mntmp = armor_to_dragon(uarm->otyp);
534             if (!(mvitals[mntmp].mvflags & G_GENOD)) {
535                 /* allow G_EXTINCT */
536                 if (Is_dragon_scales(uarm)) {
537                     /* dragon scales remain intact as uskin */
538 /*JP
539                     You("merge with your scaly armor.");
540 */
541                     You("\97Ø\82Ì\8aZ\82Æ\88ê\91Ì\89»\82µ\82½\81D");
542                 } else { /* dragon scale mail */
543                     /* d.scale mail first reverts to scales */
544                     char *p, *dsmail;
545
546                     /* similar to noarmor(invent.c),
547                        shorten to "<color> scale mail" */
548                     dsmail = strcpy(buf, simpleonames(uarm));
549 #if 0 /*JP*/
550                     if ((p = strstri(dsmail, " dragon ")) != 0)
551                         while ((p[1] = p[8]) != '\0')
552                             ++p;
553 #endif
554                     /* tricky phrasing; dragon scale mail
555                        is singular, dragon scales are plural */
556 #if 0 /*JP*/
557                     Your("%s reverts to scales as you merge with them.",
558                          dsmail);
559 #else
560                     Your("%s\82Í\97Ø\82É\96ß\82Á\82½\81D",
561                          dsmail);
562 #endif
563                     /* uarm->spe enchantment remains unchanged;
564                        re-converting scales to mail poses risk
565                        of evaporation due to over enchanting */
566                     uarm->otyp += GRAY_DRAGON_SCALES - GRAY_DRAGON_SCALE_MAIL;
567                     uarm->dknown = 1;
568                     context.botl = 1; /* AC is changing */
569                 }
570                 uskin = uarm;
571                 uarm = (struct obj *) 0;
572                 /* save/restore hack */
573                 uskin->owornmask |= I_SPECIAL;
574                 update_inventory();
575             }
576         } else if (iswere) {
577         do_shift:
578             if (Upolyd && were_beastie(mntmp) != u.ulycn)
579                 mntmp = PM_HUMAN; /* Illegal; force newman() */
580             else
581                 mntmp = u.ulycn;
582         } else if (isvamp) {
583         do_vampyr:
584             if (mntmp < LOW_PM || (mons[mntmp].geno & G_UNIQ))
585                 mntmp = (youmonst.data != &mons[PM_VAMPIRE] && !rn2(10))
586                             ? PM_WOLF
587                             : !rn2(4) ? PM_FOG_CLOUD : PM_VAMPIRE_BAT;
588             if (controllable_poly) {
589 /*JP
590                 Sprintf(buf, "Become %s?", an(mons[mntmp].mname));
591 */
592                 Sprintf(buf, "%s\82É\82È\82é\81H", mons[mntmp].mname);
593                 if (yn(buf) != 'y')
594                     return;
595             }
596         }
597         /* if polymon fails, "you feel" message has been given
598            so don't follow up with another polymon or newman;
599            sex_change_ok left disabled here */
600         if (mntmp == PM_HUMAN)
601             newman(); /* werecritter */
602         else
603             (void) polymon(mntmp);
604         goto made_change; /* maybe not, but this is right anyway */
605     }
606
607     if (mntmp < LOW_PM) {
608         tryct = 200;
609         do {
610             /* randomly pick an "ordinary" monster */
611             mntmp = rn1(SPECIAL_PM - LOW_PM, LOW_PM);
612             if (polyok(&mons[mntmp]) && !is_placeholder(&mons[mntmp]))
613                 break;
614         } while (--tryct > 0);
615     }
616
617     /* The below polyok() fails either if everything is genocided, or if
618      * we deliberately chose something illegal to force newman().
619      */
620     sex_change_ok++;
621     if (!polyok(&mons[mntmp]) || (!forcecontrol && !rn2(5))
622         || your_race(&mons[mntmp])) {
623         newman();
624     } else {
625         (void) polymon(mntmp);
626     }
627     sex_change_ok--; /* reset */
628
629 made_change:
630     new_light = emits_light(youmonst.data);
631     if (old_light != new_light) {
632         if (old_light)
633             del_light_source(LS_MONSTER, monst_to_any(&youmonst));
634         if (new_light == 1)
635             ++new_light; /* otherwise it's undetectable */
636         if (new_light)
637             new_light_source(u.ux, u.uy, new_light, LS_MONSTER,
638                              monst_to_any(&youmonst));
639     }
640 }
641
642 /* (try to) make a mntmp monster out of the player;
643    returns 1 if polymorph successful */
644 int
645 polymon(mntmp)
646 int mntmp;
647 {
648     boolean sticky = sticks(youmonst.data) && u.ustuck && !u.uswallow,
649             was_blind = !!Blind, dochange = FALSE;
650     int mlvl;
651
652     if (mvitals[mntmp].mvflags & G_GENOD) { /* allow G_EXTINCT */
653 /*JP
654         You_feel("rather %s-ish.", mons[mntmp].mname);
655 */
656         You("%s\82Á\82Û\82­\82È\82Á\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D", mons[mntmp].mname);
657         exercise(A_WIS, TRUE);
658         return 0;
659     }
660
661     /* KMH, conduct */
662     u.uconduct.polyselfs++;
663
664     /* exercise used to be at the very end but only Wis was affected
665        there since the polymorph was always in effect by then */
666     exercise(A_CON, FALSE);
667     exercise(A_WIS, TRUE);
668
669     if (!Upolyd) {
670         /* Human to monster; save human stats */
671         u.macurr = u.acurr;
672         u.mamax = u.amax;
673         u.mfemale = flags.female;
674     } else {
675         /* Monster to monster; restore human stats, to be
676          * immediately changed to provide stats for the new monster
677          */
678         u.acurr = u.macurr;
679         u.amax = u.mamax;
680         flags.female = u.mfemale;
681     }
682
683     /* if stuck mimicking gold, stop immediately */
684     if (multi < 0 && youmonst.m_ap_type == M_AP_OBJECT
685         && youmonst.data->mlet != S_MIMIC)
686         unmul("");
687     /* if becoming a non-mimic, stop mimicking anything */
688     if (mons[mntmp].mlet != S_MIMIC) {
689         /* as in polyman() */
690         youmonst.m_ap_type = M_AP_NOTHING;
691     }
692     if (is_male(&mons[mntmp])) {
693         if (flags.female)
694             dochange = TRUE;
695     } else if (is_female(&mons[mntmp])) {
696         if (!flags.female)
697             dochange = TRUE;
698     } else if (!is_neuter(&mons[mntmp]) && mntmp != u.ulycn) {
699         if (sex_change_ok && !rn2(10))
700             dochange = TRUE;
701     }
702     if (dochange) {
703         flags.female = !flags.female;
704 #if 0 /*JP*/
705         You("%s %s%s!",
706             (u.umonnum != mntmp) ? "turn into a" : "feel like a new",
707             (is_male(&mons[mntmp]) || is_female(&mons[mntmp]))
708                 ? ""
709                 : flags.female ? "female " : "male ",
710             mons[mntmp].mname);
711 #else
712         You("%s%s\82É\82È\82Á\82½%s\81I",
713             (is_male(&mons[mntmp]) || is_female(&mons[mntmp]))
714                 ? ""
715                 : flags.female ? "\8f\97\82Ì" : "\92j\82Ì",
716             mons[mntmp].mname,
717             (u.umonnum != mntmp) ? "" : "\82æ\82¤\82È\8bC\82ª\82µ\82½");
718 #endif
719     } else {
720         if (u.umonnum != mntmp)
721 /*JP
722             You("turn into %s!", an(mons[mntmp].mname));
723 */
724             You("%s\82É\82È\82Á\82½\81I", mons[mntmp].mname);
725         else
726 /*JP
727             You_feel("like a new %s!", mons[mntmp].mname);
728 */
729             You("\95Ê\82Ì%s\82É\82È\82Á\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81I", mons[mntmp].mname);
730     }
731     if (Stoned && poly_when_stoned(&mons[mntmp])) {
732         /* poly_when_stoned already checked stone golem genocide */
733         mntmp = PM_STONE_GOLEM;
734 /*JP
735         make_stoned(0L, "You turn to stone!", 0, (char *) 0);
736 */
737         make_stoned(0L, "\90Î\82É\82È\82Á\82½\81I", 0, (char *) 0);
738     }
739
740     u.mtimedone = rn1(500, 500);
741     u.umonnum = mntmp;
742     set_uasmon();
743
744     /* New stats for monster, to last only as long as polymorphed.
745      * Currently only strength gets changed.
746      */
747     if (strongmonst(&mons[mntmp]))
748         ABASE(A_STR) = AMAX(A_STR) = STR18(100);
749
750     if (Stone_resistance && Stoned) { /* parnes@eniac.seas.upenn.edu */
751 /*JP
752         make_stoned(0L, "You no longer seem to be petrifying.", 0,
753 */
754         make_stoned(0L, "\90Î\89»\82©\82ç\89ð\95ú\82³\82ê\82½\82æ\82¤\82¾\81D", 0,
755                     (char *) 0);
756     }
757     if (Sick_resistance && Sick) {
758         make_sick(0L, (char *) 0, FALSE, SICK_ALL);
759 /*JP
760         You("no longer feel sick.");
761 */
762         You("\95a\8bC\82©\82ç\89ð\95ú\82³\82ê\82½\82æ\82¤\82¾\81D");
763     }
764     if (Slimed) {
765         if (flaming(youmonst.data)) {
766 /*JP
767             make_slimed(0L, "The slime burns away!");
768 */
769             make_slimed(0L, "\83X\83\89\83C\83\80\82Í\94R\82¦\82½\81I");
770         } else if (mntmp == PM_GREEN_SLIME) {
771             /* do it silently */
772             make_slimed(0L, (char *) 0);
773         }
774     }
775     check_strangling(FALSE); /* maybe stop strangling */
776     if (nohands(youmonst.data))
777         Glib = 0;
778
779     /*
780     mlvl = adj_lev(&mons[mntmp]);
781      * We can't do the above, since there's no such thing as an
782      * "experience level of you as a monster" for a polymorphed character.
783      */
784     mlvl = (int) mons[mntmp].mlevel;
785     if (youmonst.data->mlet == S_DRAGON && mntmp >= PM_GRAY_DRAGON) {
786         u.mhmax = In_endgame(&u.uz) ? (8 * mlvl) : (4 * mlvl + d(mlvl, 4));
787     } else if (is_golem(youmonst.data)) {
788         u.mhmax = golemhp(mntmp);
789     } else {
790         if (!mlvl)
791             u.mhmax = rnd(4);
792         else
793             u.mhmax = d(mlvl, 8);
794         if (is_home_elemental(&mons[mntmp]))
795             u.mhmax *= 3;
796     }
797     u.mh = u.mhmax;
798
799     if (u.ulevel < mlvl) {
800         /* Low level characters can't become high level monsters for long */
801 #ifdef DUMB
802         /* DRS/NS 2.2.6 messes up -- Peter Kendell */
803         int mtd = u.mtimedone, ulv = u.ulevel;
804
805         u.mtimedone = mtd * ulv / mlvl;
806 #else
807         u.mtimedone = u.mtimedone * u.ulevel / mlvl;
808 #endif
809     }
810
811     if (uskin && mntmp != armor_to_dragon(uskin->otyp))
812         skinback(FALSE);
813     break_armor();
814     drop_weapon(1);
815     (void) hideunder(&youmonst);
816
817     if (u.utraptype == TT_PIT && u.utrap) {
818         u.utrap = rn1(6, 2); /* time to escape resets */
819     }
820     if (was_blind && !Blind) { /* previous form was eyeless */
821         Blinded = 1L;
822         make_blinded(0L, TRUE); /* remove blindness */
823     }
824     newsym(u.ux, u.uy); /* Change symbol */
825
826     if (!sticky && !u.uswallow && u.ustuck && sticks(youmonst.data))
827         u.ustuck = 0;
828     else if (sticky && !sticks(youmonst.data))
829         uunstick();
830     if (u.usteed) {
831         if (touch_petrifies(u.usteed->data) && !Stone_resistance && rnl(3)) {
832             char buf[BUFSZ];
833
834 #if 0 /*JP*/
835             pline("%s touch %s.", no_longer_petrify_resistant,
836                   mon_nam(u.usteed));
837 #else
838             pline("%s\82Í%s\82É\90G\82ê\82½\81D", no_longer_petrify_resistant,
839                   mon_nam(u.usteed));
840 #endif
841 /*JP
842             Sprintf(buf, "riding %s", an(u.usteed->data->mname));
843 */
844             Sprintf(buf, "%s\82É\8fæ\82Á\82Ä", u.usteed->data->mname);
845             instapetrify(buf);
846         }
847         if (!can_ride(u.usteed))
848             dismount_steed(DISMOUNT_POLY);
849     }
850
851     if (flags.verbose) {
852 /*JP
853         static const char use_thec[] = "Use the command #%s to %s.";
854 */
855         static const char use_thec[] = "#%s\83R\83}\83\93\83h\82Å%s\82±\82Æ\82ª\82Å\82«\82é\81D";
856         static const char monsterc[] = "monster";
857
858         if (can_breathe(youmonst.data))
859 /*JP
860             pline(use_thec, monsterc, "use your breath weapon");
861 */
862             pline(use_thec,monsterc, "\91§\82ð\93f\82«\82©\82¯\82é");
863         if (attacktype(youmonst.data, AT_SPIT))
864 /*JP
865             pline(use_thec, monsterc, "spit venom");
866 */
867             pline(use_thec,monsterc, "\93Å\82ð\93f\82­");
868         if (youmonst.data->mlet == S_NYMPH)
869 /*JP
870             pline(use_thec, monsterc, "remove an iron ball");
871 */
872             pline(use_thec,monsterc, "\93S\8b\85\82ð\82Í\82¸\82·");
873         if (attacktype(youmonst.data, AT_GAZE))
874 /*JP
875             pline(use_thec, monsterc, "gaze at monsters");
876 */
877             pline(use_thec,monsterc, "\89ö\95¨\82ðáÉ\82Þ");
878         if (is_hider(youmonst.data))
879 /*JP
880             pline(use_thec, monsterc, "hide");
881 */
882             pline(use_thec,monsterc, "\89B\82ê\82é");
883         if (is_were(youmonst.data))
884 /*JP
885             pline(use_thec, monsterc, "summon help");
886 */
887             pline(use_thec,monsterc, "\92\87\8aÔ\82ð\8f¢\8a«\82·\82é");
888         if (webmaker(youmonst.data))
889 /*JP
890             pline(use_thec, monsterc, "spin a web");
891 */
892             pline(use_thec,monsterc, "\82­\82à\82Ì\91\83\82ð\92£\82é");
893         if (u.umonnum == PM_GREMLIN)
894 /*JP
895             pline(use_thec, monsterc, "multiply in a fountain");
896 */
897             pline(use_thec,monsterc, "\90ò\82Ì\92\86\82Å\95ª\97ô\82·\82é");
898         if (is_unicorn(youmonst.data))
899 /*JP
900             pline(use_thec, monsterc, "use your horn");
901 */
902             pline(use_thec,monsterc, "\8ap\82ð\8eg\82¤");
903         if (is_mind_flayer(youmonst.data))
904 /*JP
905             pline(use_thec, monsterc, "emit a mental blast");
906 */
907             pline(use_thec,monsterc, "\90¸\90_\94g\82ð\94­\90\82³\82¹\82é");
908         if (youmonst.data->msound == MS_SHRIEK) /* worthless, actually */
909 /*JP
910             pline(use_thec, monsterc, "shriek");
911 */
912             pline(use_thec,monsterc, "\8bà\90Ø\82è\90º\82ð\82 \82°\82é");
913         if (is_vampire(youmonst.data))
914 /*JP
915             pline(use_thec, monsterc, "change shape");
916 */
917             pline(use_thec, monsterc, "\8ep\82ð\95Ï\82¦\82é");
918
919         if (lays_eggs(youmonst.data) && flags.female)
920 /*JP
921             pline(use_thec, "sit", "lay an egg");
922 */
923             pline(use_thec, "sit", "\97\91\82ð\8eY\82Þ");
924     }
925
926     /* you now know what an egg of your type looks like */
927     if (lays_eggs(youmonst.data)) {
928         learn_egg_type(u.umonnum);
929         /* make queen bees recognize killer bee eggs */
930         learn_egg_type(egg_type_from_parent(u.umonnum, TRUE));
931     }
932     find_ac();
933     if ((!Levitation && !u.ustuck && !Flying && is_pool_or_lava(u.ux, u.uy))
934         || (Underwater && !Swimming))
935         spoteffects(TRUE);
936     if (Passes_walls && u.utrap
937         && (u.utraptype == TT_INFLOOR || u.utraptype == TT_BURIEDBALL)) {
938         u.utrap = 0;
939         if (u.utraptype == TT_INFLOOR)
940 /*JP
941             pline_The("rock seems to no longer trap you.");
942 */
943             pline("\8aâ\82É\95Â\82\8d\9e\82ß\82ç\82ê\82é\82±\82Æ\82Í\82È\82¢\82¾\82ë\82¤\81D");
944         else {
945 /*JP
946             pline_The("buried ball is no longer bound to you.");
947 */
948             pline_The("\96\84\82Ü\82Á\82½\8b\85\82ª\8e×\96\82\82É\82È\82é\82±\82Æ\82Í\82È\82¢\82¾\82ë\82¤\81D");
949             buried_ball_to_freedom();
950         }
951     } else if (likes_lava(youmonst.data) && u.utrap
952                && u.utraptype == TT_LAVA) {
953         u.utrap = 0;
954 /*JP
955         pline_The("lava now feels soothing.");
956 */
957         pline("\97n\8aâ\82ª\90¸\90_\82ð\97\8e\82¿\82Â\82©\82¹\82Ä\82­\82ê\82é\81D");
958     }
959     if (amorphous(youmonst.data) || is_whirly(youmonst.data)
960         || unsolid(youmonst.data)) {
961         if (Punished) {
962 /*JP
963             You("slip out of the iron chain.");
964 */
965             You("\93S\82Ì\8d½\82©\82ç\82·\82é\82è\82Æ\94²\82¯\82½\81D");
966             unpunish();
967         } else if (u.utrap && u.utraptype == TT_BURIEDBALL) {
968 /*JP
969             You("slip free of the buried ball and chain.");
970 */
971             You("\96\84\82Ü\82Á\82Ä\82¢\82é\8b\85\82Æ\8d½\82©\82ç\82·\82é\82è\82Æ\94²\82¯\82½\81D");
972             buried_ball_to_freedom();
973         }
974     }
975     if (u.utrap && (u.utraptype == TT_WEB || u.utraptype == TT_BEARTRAP)
976         && (amorphous(youmonst.data) || is_whirly(youmonst.data)
977             || unsolid(youmonst.data) || (youmonst.data->msize <= MZ_SMALL
978                                           && u.utraptype == TT_BEARTRAP))) {
979 #if 0 /*JP*/
980         You("are no longer stuck in the %s.",
981             u.utraptype == TT_WEB ? "web" : "bear trap");
982 #else
983         You("%s\82©\82ç\92E\8fo\82µ\82½\81D",
984             u.utraptype == TT_WEB ? "\82­\82à\82Ì\91\83" : "\8cF\82Ìã©");
985 #endif
986         /* probably should burn webs too if PM_FIRE_ELEMENTAL */
987         u.utrap = 0;
988     }
989     if (webmaker(youmonst.data) && u.utrap && u.utraptype == TT_WEB) {
990 /*JP
991         You("orient yourself on the web.");
992 */
993         You("\82­\82à\82Ì\91\83\82É\93K\89\9e\82µ\82½\81D");
994         u.utrap = 0;
995     }
996     check_strangling(TRUE); /* maybe start strangling */
997     (void) polysense(youmonst.data);
998
999     context.botl = 1;
1000     vision_full_recalc = 1;
1001     see_monsters();
1002     (void) encumber_msg();
1003
1004     retouch_equipment(2);
1005     /* this might trigger a recursive call to polymon() [stone golem
1006        wielding cockatrice corpse and hit by stone-to-flesh, becomes
1007        flesh golem above, now gets transformed back into stone golem] */
1008     if (!uarmg)
1009         selftouch(no_longer_petrify_resistant);
1010     return 1;
1011 }
1012
1013 STATIC_OVL void
1014 break_armor()
1015 {
1016     register struct obj *otmp;
1017
1018     if (breakarm(youmonst.data)) {
1019         if ((otmp = uarm) != 0) {
1020             if (donning(otmp))
1021                 cancel_don();
1022 /*JP
1023             You("break out of your armor!");
1024 */
1025             You("\8aZ\82ð\89ó\82µ\82½\81I");
1026             exercise(A_STR, FALSE);
1027             (void) Armor_gone();
1028             useup(otmp);
1029         }
1030         if ((otmp = uarmc) != 0) {
1031             if (otmp->oartifact) {
1032 /*JP
1033                 Your("%s falls off!", cloak_simple_name(otmp));
1034 */
1035                 Your("%s\82Í\92E\82°\97\8e\82¿\82½\81I", cloak_simple_name(otmp));
1036                 (void) Cloak_off();
1037                 dropx(otmp);
1038             } else {
1039 /*JP
1040                 Your("%s tears apart!", cloak_simple_name(otmp));
1041 */
1042                 Your("%s\82Í\82¸\82½\82¸\82½\82É\88ø\82«\97ô\82©\82ê\82½\81I", cloak_simple_name(otmp));
1043                 (void) Cloak_off();
1044                 useup(otmp);
1045             }
1046         }
1047         if (uarmu) {
1048 /*JP
1049             Your("shirt rips to shreds!");
1050 */
1051             Your("\83V\83\83\83c\82Í\88ø\82«\97ô\82©\82ê\82½\81I");
1052             useup(uarmu);
1053         }
1054     } else if (sliparm(youmonst.data)) {
1055         if (((otmp = uarm) != 0) && (racial_exception(&youmonst, otmp) < 1)) {
1056             if (donning(otmp))
1057                 cancel_don();
1058 /*JP
1059             Your("armor falls around you!");
1060 */
1061             Your("\8aZ\82Í\82 \82È\82½\82Ì\82Ü\82í\82è\82É\97\8e\82¿\82½\81I");
1062             (void) Armor_gone();
1063             dropx(otmp);
1064         }
1065         if ((otmp = uarmc) != 0) {
1066             if (is_whirly(youmonst.data))
1067 /*JP
1068                 Your("%s falls, unsupported!", cloak_simple_name(otmp));
1069 */
1070                 Your("%s\82Í\82·\82Æ\82ñ\82Æ\97\8e\82¿\82½\81I", cloak_simple_name(otmp));
1071             else
1072 /*JP
1073                 You("shrink out of your %s!", cloak_simple_name(otmp));
1074 */
1075                 You("%s\82©\82ç\8fk\82Ý\8fo\82½\81I", cloak_simple_name(otmp));
1076             (void) Cloak_off();
1077             dropx(otmp);
1078         }
1079         if ((otmp = uarmu) != 0) {
1080             if (is_whirly(youmonst.data))
1081 /*JP
1082                 You("seep right through your shirt!");
1083 */
1084                 You("\83V\83\83\83c\82©\82ç\82µ\82Ý\8fo\82½\81I");
1085             else
1086 /*JP
1087                 You("become much too small for your shirt!");
1088 */
1089                 You("\83V\83\83\83c\82æ\82è\82¸\82Á\82Æ\8f¬\82³\82­\82È\82Á\82½\81I");
1090             setworn((struct obj *) 0, otmp->owornmask & W_ARMU);
1091             dropx(otmp);
1092         }
1093     }
1094     if (has_horns(youmonst.data)) {
1095         if ((otmp = uarmh) != 0) {
1096             if (is_flimsy(otmp) && !donning(otmp)) {
1097 #if 0 /*JP*/
1098                 char hornbuf[BUFSZ];
1099
1100                 /* Future possibilities: This could damage/destroy helmet */
1101                 Sprintf(hornbuf, "horn%s", plur(num_horns(youmonst.data)));
1102                 Your("%s %s through %s.", hornbuf, vtense(hornbuf, "pierce"),
1103                      yname(otmp));
1104 #else
1105                 Your("\8ap\82ª%s\82ð\82Â\82ç\82Ê\82¢\82½\81D", yname(otmp));
1106 #endif
1107             } else {
1108                 if (donning(otmp))
1109                     cancel_don();
1110 #if 0 /*JP*/
1111                 Your("%s falls to the %s!", helm_simple_name(otmp),
1112                      surface(u.ux, u.uy));
1113 #else
1114                 Your("%s\82Í%s\82É\97\8e\82¿\82½\81I", helm_simple_name(otmp),
1115                      surface(u.ux, u.uy));
1116 #endif
1117                 (void) Helmet_off();
1118                 dropx(otmp);
1119             }
1120         }
1121     }
1122     if (nohands(youmonst.data) || verysmall(youmonst.data)) {
1123         if ((otmp = uarmg) != 0) {
1124             if (donning(otmp))
1125                 cancel_don();
1126             /* Drop weapon along with gloves */
1127 /*JP
1128             You("drop your gloves%s!", uwep ? " and weapon" : "");
1129 */
1130             You("\8f¬\8eè%s\82ð\97\8e\82µ\82½\81I", uwep ? "\82â\95\90\8aí" : "");
1131             drop_weapon(0);
1132             (void) Gloves_off();
1133             dropx(otmp);
1134         }
1135         if ((otmp = uarms) != 0) {
1136 /*JP
1137             You("can no longer hold your shield!");
1138 */
1139             You("\82à\82¤\8f\82\82ð\8e\9d\82Á\82Ä\82ç\82ê\82È\82¢\81I");
1140             (void) Shield_off();
1141             dropx(otmp);
1142         }
1143         if ((otmp = uarmh) != 0) {
1144             if (donning(otmp))
1145                 cancel_don();
1146 #if 0 /*JP*/
1147             Your("%s falls to the %s!", helm_simple_name(otmp),
1148                  surface(u.ux, u.uy));
1149 #else
1150             Your("%s\82Í%s\82É\97\8e\82¿\82½\81I", helm_simple_name(otmp),
1151                  surface(u.ux, u.uy));
1152 #endif
1153             (void) Helmet_off();
1154             dropx(otmp);
1155         }
1156     }
1157     if (nohands(youmonst.data) || verysmall(youmonst.data)
1158         || slithy(youmonst.data) || youmonst.data->mlet == S_CENTAUR) {
1159         if ((otmp = uarmf) != 0) {
1160             if (donning(otmp))
1161                 cancel_don();
1162             if (is_whirly(youmonst.data))
1163 /*JP
1164                 Your("boots fall away!");
1165 */
1166                 Your("\8cC\82Í\92E\82°\97\8e\82¿\82½\81I");
1167             else
1168 #if 0 /*JP*/
1169                 Your("boots %s off your feet!",
1170                      verysmall(youmonst.data) ? "slide" : "are pushed");
1171 #else
1172                 Your("\8cC\82Í\82 \82È\82½\82Ì\91«\82©\82ç%s\81I",
1173                      verysmall(youmonst.data) ? "\8a\8a\82è\97\8e\82¿\82½" : "\92E\82°\97\8e\82¿\82½");
1174 #endif
1175             (void) Boots_off();
1176             dropx(otmp);
1177         }
1178     }
1179 }
1180
1181 STATIC_OVL void
1182 drop_weapon(alone)
1183 int alone;
1184 {
1185     struct obj *otmp;
1186     const char *what, *which, *whichtoo;
1187     boolean candropwep, candropswapwep;
1188
1189     if (uwep) {
1190         /* !alone check below is currently superfluous but in the
1191          * future it might not be so if there are monsters which cannot
1192          * wear gloves but can wield weapons
1193          */
1194         if (!alone || cantwield(youmonst.data)) {
1195             candropwep = canletgo(uwep, "");
1196             candropswapwep = !u.twoweap || canletgo(uswapwep, "");
1197             if (alone) {
1198 #if 0 /*JP*/
1199                 what = (candropwep && candropswapwep) ? "drop" : "release";
1200 #endif
1201 /*JP
1202                 which = is_sword(uwep) ? "sword" : weapon_descr(uwep);
1203 */
1204                 which = is_sword(uwep) ? "\8c\95" : weapon_descr(uwep);
1205                 if (u.twoweap) {
1206                     whichtoo =
1207 /*JP
1208                         is_sword(uswapwep) ? "sword" : weapon_descr(uswapwep);
1209 */
1210                         is_sword(uswapwep) ? "\8c\95" : weapon_descr(uswapwep);
1211                     if (strcmp(which, whichtoo))
1212 /*JP
1213                         which = "weapon";
1214 */
1215                         which = "\95\90\8aí";
1216                 }
1217 #if 0 /*JP*//*\95¡\90\94\8c`\82É\82µ\82È\82¢*/
1218                 if (uwep->quan != 1L || u.twoweap)
1219                     which = makeplural(which);
1220 #endif
1221
1222 #if 0 /*JP*/
1223                 You("find you must %s %s %s!", what,
1224                     the_your[!!strncmp(which, "corpse", 6)], which);
1225 #else
1226                 You("%s\82ð\97\8e\82Æ\82µ\82½\82±\82Æ\82É\8bC\82Ã\82¢\82½\81I", which);
1227 #endif
1228             }
1229             if (u.twoweap) {
1230                 otmp = uswapwep;
1231                 uswapwepgone();
1232                 if (candropswapwep)
1233                     dropx(otmp);
1234             }
1235             otmp = uwep;
1236             uwepgone();
1237             if (candropwep)
1238                 dropx(otmp);
1239             update_inventory();
1240         } else if (!could_twoweap(youmonst.data)) {
1241             untwoweapon();
1242         }
1243     }
1244 }
1245
1246 void
1247 rehumanize()
1248 {
1249     /* You can't revert back while unchanging */
1250     if (Unchanging && (u.mh < 1)) {
1251         killer.format = NO_KILLER_PREFIX;
1252 /*JP
1253         Strcpy(killer.name, "killed while stuck in creature form");
1254 */
1255         Strcpy(killer.name, "\8c³\82Ì\8ep\82Ö\96ß\82ê\82¸\82É");
1256         done(DIED);
1257     }
1258
1259     if (emits_light(youmonst.data))
1260         del_light_source(LS_MONSTER, monst_to_any(&youmonst));
1261 /*JP
1262     polyman("return to %s form!", urace.adj);
1263 */
1264     polyman("%s\82É\96ß\82Á\82½\81I", urace.adj);
1265
1266     if (u.uhp < 1) {
1267         /* can only happen if some bit of code reduces u.uhp
1268            instead of u.mh while poly'd */
1269 /*JP
1270         Your("old form was not healthy enough to survive.");
1271 */
1272         Your("\8c³\82Ì\8ep\82Í\90\82«\82Ä\82¢\82­\82¾\82¯\82Ì\97Í\82ª\82È\82¢\81D");
1273 /*JP
1274         Sprintf(killer.name, "reverting to unhealthy %s form", urace.adj);
1275 */
1276         Sprintf(killer.name, "\95s\8c\92\8dN\82È%s\82Ì\8ep\82É\96ß\82Á\82Ä", urace.adj);
1277         killer.format = KILLED_BY;
1278         done(DIED);
1279     }
1280     nomul(0);
1281
1282     context.botl = 1;
1283     vision_full_recalc = 1;
1284     (void) encumber_msg();
1285
1286     retouch_equipment(2);
1287     if (!uarmg)
1288         selftouch(no_longer_petrify_resistant);
1289 }
1290
1291 int
1292 dobreathe()
1293 {
1294     struct attack *mattk;
1295
1296     if (Strangled) {
1297 /*JP
1298         You_cant("breathe.  Sorry.");
1299 */
1300         You_cant("\91§\82ð\93f\82­\82±\82Æ\82ª\82Å\82«\82È\82¢\81D\8ec\94O\81D");
1301         return 0;
1302     }
1303     if (u.uen < 15) {
1304 /*JP
1305         You("don't have enough energy to breathe!");
1306 */
1307         You("\91§\82ð\93f\82­\82Ì\82É\8f\\95ª\82È\83G\83l\83\8b\83M\81[\82ª\82È\82©\82Á\82½\81D");
1308         return 0;
1309     }
1310     u.uen -= 15;
1311     context.botl = 1;
1312
1313     if (!getdir((char *) 0))
1314         return 0;
1315
1316     mattk = attacktype_fordmg(youmonst.data, AT_BREA, AD_ANY);
1317     if (!mattk)
1318         impossible("bad breath attack?"); /* mouthwash needed... */
1319     else if (!u.dx && !u.dy && !u.dz)
1320         ubreatheu(mattk);
1321     else
1322         buzz((int) (20 + mattk->adtyp - 1), (int) mattk->damn, u.ux, u.uy,
1323              u.dx, u.dy);
1324     return 1;
1325 }
1326
1327 int
1328 dospit()
1329 {
1330     struct obj *otmp;
1331     struct attack *mattk;
1332
1333     if (!getdir((char *) 0))
1334         return 0;
1335     mattk = attacktype_fordmg(youmonst.data, AT_SPIT, AD_ANY);
1336     if (!mattk) {
1337         impossible("bad spit attack?");
1338     } else {
1339         switch (mattk->adtyp) {
1340         case AD_BLND:
1341         case AD_DRST:
1342             otmp = mksobj(BLINDING_VENOM, TRUE, FALSE);
1343             break;
1344         default:
1345             impossible("bad attack type in dospit");
1346         /* fall through */
1347         case AD_ACID:
1348             otmp = mksobj(ACID_VENOM, TRUE, FALSE);
1349             break;
1350         }
1351         otmp->spe = 1; /* to indicate it's yours */
1352         throwit(otmp, 0L, FALSE);
1353     }
1354     return 1;
1355 }
1356
1357 int
1358 doremove()
1359 {
1360     if (!Punished) {
1361         if (u.utrap && u.utraptype == TT_BURIEDBALL) {
1362 #if 0 /*JP*/
1363             pline_The("ball and chain are buried firmly in the %s.",
1364                       surface(u.ux, u.uy));
1365 #else
1366             pline_The("\8b\85\82Æ\8d½\82Í%s\82É\82µ\82Á\82©\82è\82Æ\96\84\82Ü\82Á\82Ä\82¢\82é\81D.",
1367                       surface(u.ux, u.uy));
1368 #endif
1369             return 0;
1370         }
1371 /*JP
1372         You("are not chained to anything!");
1373 */
1374         You("\89½\82à\82Â\82È\82ª\82ê\82Ä\82¢\82È\82¢\81I");
1375         return 0;
1376     }
1377     unpunish();
1378     return 1;
1379 }
1380
1381 int
1382 dospinweb()
1383 {
1384     register struct trap *ttmp = t_at(u.ux, u.uy);
1385
1386     if (Levitation || Is_airlevel(&u.uz) || Underwater
1387         || Is_waterlevel(&u.uz)) {
1388 /*JP
1389         You("must be on the ground to spin a web.");
1390 */
1391         You("\82­\82à\82Ì\91\83\82ð\92£\82é\82É\82Í\92n\96Ê\82Ì\8fã\82É\82¢\82È\82­\82Ä\82Í\82È\82ç\82È\82¢\81D");
1392         return 0;
1393     }
1394     if (u.uswallow) {
1395 /*JP
1396         You("release web fluid inside %s.", mon_nam(u.ustuck));
1397 */
1398         You("%s\82Ì\93à\82Å\82­\82à\82Ì\91\83\82ð\93f\82«\8fo\82µ\82½\81D", mon_nam(u.ustuck));
1399         if (is_animal(u.ustuck->data)) {
1400             expels(u.ustuck, u.ustuck->data, TRUE);
1401             return 0;
1402         }
1403         if (is_whirly(u.ustuck->data)) {
1404             int i;
1405
1406             for (i = 0; i < NATTK; i++)
1407                 if (u.ustuck->data->mattk[i].aatyp == AT_ENGL)
1408                     break;
1409             if (i == NATTK)
1410                 impossible("Swallower has no engulfing attack?");
1411             else {
1412                 char sweep[30];
1413
1414                 sweep[0] = '\0';
1415                 switch (u.ustuck->data->mattk[i].adtyp) {
1416                 case AD_FIRE:
1417 /*JP
1418                     Strcpy(sweep, "ignites and ");
1419 */
1420                     Strcpy(sweep, "\94­\89Î\82µ");
1421                     break;
1422                 case AD_ELEC:
1423 /*JP
1424                     Strcpy(sweep, "fries and ");
1425 */
1426                     Strcpy(sweep, "\8fÅ\82°");
1427                     break;
1428                 case AD_COLD:
1429 /*JP
1430                     Strcpy(sweep, "freezes, shatters and ");
1431 */
1432                     Strcpy(sweep, "\93\80\82è\82Â\82«\81C\82±\82È\82²\82È\82É\82È\82è");
1433                     break;
1434                 }
1435 /*JP
1436                 pline_The("web %sis swept away!", sweep);
1437 */
1438                 pline("\82­\82à\82Ì\91\83\82Í%s\82È\82­\82È\82Á\82½\81I", sweep);
1439             }
1440             return 0;
1441         } /* default: a nasty jelly-like creature */
1442 /*JP
1443         pline_The("web dissolves into %s.", mon_nam(u.ustuck));
1444 */
1445         pline("\82­\82à\82Ì\91\83\82Í\95ª\89ð\82µ\82Ä%s\82É\82È\82Á\82½\81D", mon_nam(u.ustuck));
1446         return 0;
1447     }
1448     if (u.utrap) {
1449 /*JP
1450         You("cannot spin webs while stuck in a trap.");
1451 */
1452         You("ã©\82É\82Í\82Ü\82Á\82Ä\82¢\82é\8aÔ\82Í\82­\82à\82Ì\91\83\82ð\92£\82ê\82È\82¢\81D");
1453         return 0;
1454     }
1455     exercise(A_DEX, TRUE);
1456     if (ttmp) {
1457         switch (ttmp->ttyp) {
1458         case PIT:
1459         case SPIKED_PIT:
1460 /*JP
1461             You("spin a web, covering up the pit.");
1462 */
1463             You("\82­\82à\82Ì\91\83\82ð\92£\82è\81C\97\8e\82µ\8c\8a\82ð\95¢\82Á\82½\81D");
1464             deltrap(ttmp);
1465             bury_objs(u.ux, u.uy);
1466             newsym(u.ux, u.uy);
1467             return 1;
1468         case SQKY_BOARD:
1469 /*JP
1470             pline_The("squeaky board is muffled.");
1471 */
1472             pline("\82«\82µ\82Þ\94Â\82Í\95¢\82í\82ê\82½\81D");
1473             deltrap(ttmp);
1474             newsym(u.ux, u.uy);
1475             return 1;
1476         case TELEP_TRAP:
1477         case LEVEL_TELEP:
1478         case MAGIC_PORTAL:
1479         case VIBRATING_SQUARE:
1480 /*JP
1481             Your("webbing vanishes!");
1482 */
1483             Your("\82­\82à\82Ì\91\83\82Í\8fÁ\82¦\82½\81I");
1484             return 0;
1485         case WEB:
1486 /*JP
1487             You("make the web thicker.");
1488 */
1489             You("\82­\82à\82Ì\91\83\82ð\82æ\82è\8cú\82­\82µ\82½\81D");
1490             return 1;
1491         case HOLE:
1492         case TRAPDOOR:
1493 #if 0 /*JP*/
1494             You("web over the %s.",
1495                 (ttmp->ttyp == TRAPDOOR) ? "trap door" : "hole");
1496 #else
1497             You("%s\82ð\82­\82à\82Ì\91\83\82Å\95¢\82Á\82½\81D",
1498                 (ttmp->ttyp == TRAPDOOR) ? "\97\8e\82µ\94à" : "\8c\8a");
1499 #endif
1500             deltrap(ttmp);
1501             newsym(u.ux, u.uy);
1502             return 1;
1503         case ROLLING_BOULDER_TRAP:
1504 /*JP
1505             You("spin a web, jamming the trigger.");
1506 */
1507             You("\82­\82à\82Ì\91\83\82ð\92£\82Á\82Ä\81C\83X\83C\83b\83`\82ð\93®\82©\82È\82­\82µ\82½\81D");
1508             deltrap(ttmp);
1509             newsym(u.ux, u.uy);
1510             return 1;
1511         case ARROW_TRAP:
1512         case DART_TRAP:
1513         case BEAR_TRAP:
1514         case ROCKTRAP:
1515         case FIRE_TRAP:
1516         case LANDMINE:
1517         case SLP_GAS_TRAP:
1518         case RUST_TRAP:
1519         case MAGIC_TRAP:
1520         case ANTI_MAGIC:
1521         case POLY_TRAP:
1522 /*JP
1523             You("have triggered a trap!");
1524 */
1525             You("ã©\82ð\8en\93®\82³\82¹\82Ä\82µ\82Ü\82Á\82½\81I");
1526             dotrap(ttmp, 0);
1527             return 1;
1528         default:
1529             impossible("Webbing over trap type %d?", ttmp->ttyp);
1530             return 0;
1531         }
1532     } else if (On_stairs(u.ux, u.uy)) {
1533         /* cop out: don't let them hide the stairs */
1534 #if 0 /*JP:T*/
1535         Your("web fails to impede access to the %s.",
1536              (levl[u.ux][u.uy].typ == STAIRS) ? "stairs" : "ladder");
1537 #else
1538         Your("\82­\82à\82Ì\91\83\82Í%s\82Ö\82Ì\88Ú\93®\82ð\8e×\96\82\82Å\82«\82È\82¢\81D",
1539              (levl[u.ux][u.uy].typ == STAIRS) ? "\8aK\92i" : "\82Í\82µ\82²");
1540 #endif
1541         return 1;
1542     }
1543     ttmp = maketrap(u.ux, u.uy, WEB);
1544     if (ttmp) {
1545         ttmp->madeby_u = 1;
1546         feeltrap(ttmp);
1547     }
1548     return 1;
1549 }
1550
1551 int
1552 dosummon()
1553 {
1554     int placeholder;
1555     if (u.uen < 10) {
1556 /*JP
1557         You("lack the energy to send forth a call for help!");
1558 */
1559         You("\8f\95\82¯\82ð\8cÄ\82Ô\82¾\82¯\82Ì\91Ì\97Í\82ª\82È\82¢\81I");
1560         return 0;
1561     }
1562     u.uen -= 10;
1563     context.botl = 1;
1564
1565 /*JP
1566     You("call upon your brethren for help!");
1567 */
1568     You("\92\87\8aÔ\82ð\8cÄ\82ñ\82¾\81I");
1569     exercise(A_WIS, TRUE);
1570     if (!were_summon(youmonst.data, TRUE, &placeholder, (char *) 0))
1571 /*JP
1572         pline("But none arrive.");
1573 */
1574         pline("\82µ\82©\82µ\81C\89½\82à\97\88\82È\82¢\81D");
1575     return 1;
1576 }
1577
1578 int
1579 dogaze()
1580 {
1581     register struct monst *mtmp;
1582     int looked = 0;
1583     char qbuf[QBUFSZ];
1584     int i;
1585     uchar adtyp = 0;
1586
1587     for (i = 0; i < NATTK; i++) {
1588         if (youmonst.data->mattk[i].aatyp == AT_GAZE) {
1589             adtyp = youmonst.data->mattk[i].adtyp;
1590             break;
1591         }
1592     }
1593     if (adtyp != AD_CONF && adtyp != AD_FIRE) {
1594         impossible("gaze attack %d?", adtyp);
1595         return 0;
1596     }
1597
1598     if (Blind) {
1599 /*JP
1600         You_cant("see anything to gaze at.");
1601 */
1602         You("\96Ú\82ª\8c©\82¦\82È\82¢\82Ì\82Å\81C\82É\82ç\82ß\82È\82¢\81D");
1603         return 0;
1604     } else if (Hallucination) {
1605 /*JP
1606         You_cant("gaze at anything you can see.");
1607 */
1608         You_cant("\8c©\82¦\82é\82à\82Ì\82ð\89½\82à\82É\82ç\82ß\82È\82¢\81D");
1609         return 0;
1610     }
1611     if (u.uen < 15) {
1612 /*JP
1613         You("lack the energy to use your special gaze!");
1614 */
1615         You("\82É\82ç\82Þ\82¾\82¯\82Ì\91Ì\97Í\82ª\82È\82¢\81I");
1616         return 0;
1617     }
1618     u.uen -= 15;
1619     context.botl = 1;
1620
1621     for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
1622         if (DEADMONSTER(mtmp))
1623             continue;
1624         if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my)) {
1625             looked++;
1626             if (Invis && !perceives(mtmp->data)) {
1627 /*JP
1628                 pline("%s seems not to notice your gaze.", Monnam(mtmp));
1629 */
1630                 pline("%s\82Í\82 \82È\82½\82Ì\82É\82ç\82Ý\82É\8bC\82ª\82Â\82¢\82Ä\82È\82¢\82æ\82¤\82¾\81D", Monnam(mtmp));
1631             } else if (mtmp->minvis && !See_invisible) {
1632 /*JP
1633                 You_cant("see where to gaze at %s.", Monnam(mtmp));
1634 */
1635                 You("%s\82Í\8c©\82¦\82È\82¢\82Ì\82Å\81C\82É\82ç\82ß\82È\82¢", Monnam(mtmp));
1636             } else if (mtmp->m_ap_type == M_AP_FURNITURE
1637                        || mtmp->m_ap_type == M_AP_OBJECT) {
1638                 looked--;
1639                 continue;
1640             } else if (flags.safe_dog && mtmp->mtame && !Confusion) {
1641 /*JP
1642                 You("avoid gazing at %s.", y_monnam(mtmp));
1643 */
1644                 You("%s\82©\82ç\96Ú\82ð\82»\82ç\82µ\82Ä\82µ\82Ü\82Á\82½\81D", y_monnam(mtmp));
1645             } else {
1646                 if (flags.confirm && mtmp->mpeaceful && !Confusion) {
1647 #if 0 /*JP*/
1648                     Sprintf(qbuf, "Really %s %s?",
1649                             (adtyp == AD_CONF) ? "confuse" : "attack",
1650                             mon_nam(mtmp));
1651 #else
1652                     Sprintf(qbuf, "\96{\93\96\82É%s\82ð%s\81H",
1653                             mon_nam(mtmp),
1654                             (adtyp == AD_CONF) ? "\8d¬\97\90\82³\82¹\82é" : "\8dU\8c\82\82·\82é");
1655 #endif
1656                     if (yn(qbuf) != 'y')
1657                         continue;
1658                     setmangry(mtmp);
1659                 }
1660                 if (!mtmp->mcanmove || mtmp->mstun || mtmp->msleeping
1661                     || !mtmp->mcansee || !haseyes(mtmp->data)) {
1662                     looked--;
1663                     continue;
1664                 }
1665                 /* No reflection check for consistency with when a monster
1666                  * gazes at *you*--only medusa gaze gets reflected then.
1667                  */
1668                 if (adtyp == AD_CONF) {
1669                     if (!mtmp->mconf)
1670 /*JP
1671                         Your("gaze confuses %s!", mon_nam(mtmp));
1672 */
1673                         Your("\82É\82ç\82Ý\82Í%s\82ð\8d¬\97\90\82³\82¹\82½\81I", mon_nam(mtmp));
1674                     else
1675 /*JP
1676                         pline("%s is getting more and more confused.",
1677 */
1678                         pline("%s\82Í\82Ü\82·\82Ü\82·\8d¬\97\90\82µ\82½\81I",
1679                               Monnam(mtmp));
1680                     mtmp->mconf = 1;
1681                 } else if (adtyp == AD_FIRE) {
1682                     int dmg = d(2, 6), lev = (int) u.ulevel;
1683
1684 /*JP
1685                     You("attack %s with a fiery gaze!", mon_nam(mtmp));
1686 */
1687                     You("\89\8a\82Ì\82É\82ç\82Ý\82Å%s\82ð\8dU\8c\82\82µ\82½\81I", mon_nam(mtmp));
1688                     if (resists_fire(mtmp)) {
1689 /*JP
1690                         pline_The("fire doesn't burn %s!", mon_nam(mtmp));
1691 */
1692                         pline("%s\82Í\89\8a\82Å\94R\82¦\82È\82©\82Á\82½\81I", mon_nam(mtmp));
1693                         dmg = 0;
1694                     }
1695                     if (lev > rn2(20))
1696                         (void) destroy_mitem(mtmp, SCROLL_CLASS, AD_FIRE);
1697                     if (lev > rn2(20))
1698                         (void) destroy_mitem(mtmp, POTION_CLASS, AD_FIRE);
1699                     if (lev > rn2(25))
1700                         (void) destroy_mitem(mtmp, SPBOOK_CLASS, AD_FIRE);
1701                     if (dmg)
1702                         mtmp->mhp -= dmg;
1703                     if (mtmp->mhp <= 0)
1704                         killed(mtmp);
1705                 }
1706                 /* For consistency with passive() in uhitm.c, this only
1707                  * affects you if the monster is still alive.
1708                  */
1709                 if (DEADMONSTER(mtmp))
1710                     continue;
1711
1712                 if (mtmp->data == &mons[PM_FLOATING_EYE] && !mtmp->mcan) {
1713                     if (!Free_action) {
1714 /*JP
1715                         You("are frozen by %s gaze!",
1716 */
1717                         You("%s\82Ì\82É\82ç\82Ý\82Å\93®\82¯\82È\82­\82È\82Á\82½\81I", 
1718                             s_suffix(mon_nam(mtmp)));
1719                         nomul((u.ulevel > 6 || rn2(4))
1720                                   ? -d((int) mtmp->m_lev + 1,
1721                                        (int) mtmp->data->mattk[0].damd)
1722                                   : -200);
1723                         multi_reason = "frozen by a monster's gaze";
1724                         nomovemsg = 0;
1725                         return 1;
1726                     } else
1727 /*JP
1728                         You("stiffen momentarily under %s gaze.",
1729 */
1730                         You("%s\82Ì\82É\82ç\82Ý\82Å\88ê\8fu\8dd\92¼\82µ\82½\81D",
1731                             s_suffix(mon_nam(mtmp)));
1732                 }
1733                 /* Technically this one shouldn't affect you at all because
1734                  * the Medusa gaze is an active monster attack that only
1735                  * works on the monster's turn, but for it to *not* have an
1736                  * effect would be too weird.
1737                  */
1738                 if (mtmp->data == &mons[PM_MEDUSA] && !mtmp->mcan) {
1739 /*JP
1740                     pline("Gazing at the awake %s is not a very good idea.",
1741 */
1742                     pline("\96Ú\82ð\8ao\82Ü\82µ\82Ä\82¢\82é%s\82ð\82É\82ç\82Þ\82Ì\82Í\8c«\82¢\82±\82Æ\82\82á\82È\82¢\81D",
1743                           l_monnam(mtmp));
1744                     /* as if gazing at a sleeping anything is fruitful... */
1745 /*JP
1746                     You("turn to stone...");
1747 */
1748                     You("\90Î\82É\82È\82Á\82½\81D\81D\81D");
1749                     killer.format = KILLED_BY;
1750 /*JP
1751                     Strcpy(killer.name, "deliberately meeting Medusa's gaze");
1752 */
1753                     Strcpy(killer.name, "\82í\82´\82í\82´\83\81\83f\83\85\81[\83T\82Ì\82É\82ç\82Ý\82ð\82Ü\82Æ\82à\82É\8c©\82Ä");
1754                     done(STONING);
1755                 }
1756             }
1757         }
1758     }
1759     if (!looked)
1760 /*JP
1761         You("gaze at no place in particular.");
1762 */
1763         You("\8eÀ\8dÛ\82É\82Í\89½\82à\82É\82ç\82ß\82È\82©\82Á\82½\81D");
1764     return 1;
1765 }
1766
1767 int
1768 dohide()
1769 {
1770     boolean ismimic = youmonst.data->mlet == S_MIMIC,
1771             on_ceiling = is_clinger(youmonst.data) || Flying;
1772
1773     /* can't hide while being held (or holding) or while trapped
1774        (except for floor hiders [trapper or mimic] in pits) */
1775     if (u.ustuck || (u.utrap && (u.utraptype != TT_PIT || on_ceiling))) {
1776 #if 0 /*JP*/
1777         You_cant("hide while you're %s.",
1778                  !u.ustuck ? "trapped" : !sticks(youmonst.data)
1779                                              ? "being held"
1780                                              : humanoid(u.ustuck->data)
1781                                                    ? "holding someone"
1782                                                    : "holding that creature");
1783 #else
1784         You_cant("%s\8aÔ\82Í\89B\82ê\82ç\82ê\82È\82¢\81D",
1785                  !u.ustuck ? "\95ß\82Ü\82Á\82Ä\82¢\82é" : !sticks(youmonst.data)
1786                                              ? "\95ß\82Ü\82¦\82ç\82ê\82Ä\82¢\82é"
1787                                              : humanoid(u.ustuck->data)
1788                                                    ? "\92N\82©\82ð\82Â\82©\82ñ\82Å\82¢\82é"
1789                                                    : "\89ö\95¨\82ð\82Â\82©\82ñ\82Å\82¢\82é");
1790 #endif
1791         if (u.uundetected
1792             || (ismimic && youmonst.m_ap_type != M_AP_NOTHING)) {
1793             u.uundetected = 0;
1794             youmonst.m_ap_type = M_AP_NOTHING;
1795             newsym(u.ux, u.uy);
1796         }
1797         return 0;
1798     }
1799     /* note: the eel and hides_under cases are hypothetical;
1800        such critters aren't offered the option of hiding via #monster */
1801     if (youmonst.data->mlet == S_EEL && !is_pool(u.ux, u.uy)) {
1802         if (IS_FOUNTAIN(levl[u.ux][u.uy].typ))
1803 /*JP
1804             The("fountain is not deep enough to hide in.");
1805 */
1806             The("\90ò\82Í\89B\82ê\82ç\82ê\82é\82Ù\82Ç\90[\82­\82È\82¢\81D");
1807         else
1808 /*JP
1809             There("is no water to hide in here.");
1810 */
1811             There("\82±\82±\82É\82Í\89B\82ê\82é\82½\82ß\82Ì\90\85\82ª\82È\82¢\81D");
1812         u.uundetected = 0;
1813         return 0;
1814     }
1815     if (hides_under(youmonst.data) && !level.objects[u.ux][u.uy]) {
1816 /*JP
1817         There("is nothing to hide under here.");
1818 */
1819         There("\82±\82±\82É\82Í\89B\82ê\82ç\82ê\82é\82à\82Ì\82ª\82È\82¢\81D");
1820         u.uundetected = 0;
1821         return 0;
1822     }
1823     /* Planes of Air and Water */
1824     if (on_ceiling && !has_ceiling(&u.uz)) {
1825 /*JP
1826         There("is nowhere to hide above you.");
1827 */
1828         There("\82 \82È\82½\82Ì\8fã\82É\82Í\89B\82ê\82ç\82ê\82é\8fê\8f\8a\82ª\82È\82¢\81D");
1829         u.uundetected = 0;
1830         return 0;
1831     }
1832     if ((is_hider(youmonst.data) && !Flying) /* floor hider */
1833         && (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))) {
1834 /*JP
1835         There("is nowhere to hide beneath you.");
1836 */
1837         There("\82 \82È\82½\82Ì\89º\82É\82Í\89B\82ê\82ç\82ê\82é\8fê\8f\8a\82ª\82È\82¢\81D");
1838         u.uundetected = 0;
1839         return 0;
1840     }
1841     /* TODO? inhibit floor hiding at furniture locations, or
1842      * else make youhiding() give smarter messages at such spots.
1843      */
1844
1845     if (u.uundetected || (ismimic && youmonst.m_ap_type != M_AP_NOTHING)) {
1846         youhiding(FALSE, 1); /* "you are already hiding" */
1847         return 0;
1848     }
1849
1850     if (ismimic) {
1851         /* should bring up a dialog "what would you like to imitate?" */
1852         youmonst.m_ap_type = M_AP_OBJECT;
1853         youmonst.mappearance = STRANGE_OBJECT;
1854     } else
1855         u.uundetected = 1;
1856     newsym(u.ux, u.uy);
1857     youhiding(FALSE, 0); /* "you are now hiding" */
1858     return 1;
1859 }
1860
1861 int
1862 dopoly()
1863 {
1864     struct permonst *savedat = youmonst.data;
1865
1866     if (is_vampire(youmonst.data)) {
1867         polyself(2);
1868         if (savedat != youmonst.data) {
1869 /*JP
1870             You("transform into %s.", an(youmonst.data->mname));
1871 */
1872             You("%s\82Ì\8ep\82É\82È\82Á\82½\81D", youmonst.data->mname);
1873             newsym(u.ux, u.uy);
1874         }
1875     }
1876     return 1;
1877 }
1878
1879 int
1880 domindblast()
1881 {
1882     struct monst *mtmp, *nmon;
1883
1884     if (u.uen < 10) {
1885 /*JP
1886         You("concentrate but lack the energy to maintain doing so.");
1887 */
1888         You("\8fW\92\86\82µ\82½\81D\82µ\82©\82µ\83G\83l\83\8b\83M\81[\82ª\91«\82è\82È\82¢\81D");
1889         return 0;
1890     }
1891     u.uen -= 10;
1892     context.botl = 1;
1893
1894 /*JP
1895     You("concentrate.");
1896 */
1897     You("\8fW\92\86\82µ\82½\81D");
1898 /*JP
1899     pline("A wave of psychic energy pours out.");
1900 */
1901     pline("\90¸\90_\83G\83l\83\8b\83M\81[\94g\82ª\95ú\8eU\82µ\82½\81D");
1902     for (mtmp = fmon; mtmp; mtmp = nmon) {
1903         int u_sen;
1904
1905         nmon = mtmp->nmon;
1906         if (DEADMONSTER(mtmp))
1907             continue;
1908         if (distu(mtmp->mx, mtmp->my) > BOLT_LIM * BOLT_LIM)
1909             continue;
1910         if (mtmp->mpeaceful)
1911             continue;
1912         u_sen = telepathic(mtmp->data) && !mtmp->mcansee;
1913         if (u_sen || (telepathic(mtmp->data) && rn2(2)) || !rn2(10)) {
1914 #if 0 /*JP*/
1915             You("lock in on %s %s.", s_suffix(mon_nam(mtmp)),
1916                 u_sen ? "telepathy"
1917                       : telepathic(mtmp->data) ? "latent telepathy" : "mind");
1918 #else
1919             pline("%s\82Ì%s\82è\8d\9e\82ñ\82¾\81D", mon_nam(mtmp),
1920                 u_sen ? "\90¸\90_\82É\93ü"
1921                       : telepathic(mtmp->data) ? "\90ö\8dÝ\93I\90¸\90_\82É\93ü" : "\90[\91w\88Ó\8e¯\82É\90ö");
1922 #endif
1923             mtmp->mhp -= rnd(15);
1924             if (mtmp->mhp <= 0)
1925                 killed(mtmp);
1926         }
1927     }
1928     return 1;
1929 }
1930
1931 STATIC_OVL void
1932 uunstick()
1933 {
1934 /*JP
1935     pline("%s is no longer in your clutches.", Monnam(u.ustuck));
1936 */
1937     pline("%s\82Í\82 \82È\82½\82Ì\8eè\82©\82ç\93¦\82ê\82½\81D", Monnam(u.ustuck));
1938     u.ustuck = 0;
1939 }
1940
1941 void
1942 skinback(silently)
1943 boolean silently;
1944 {
1945     if (uskin) {
1946         if (!silently)
1947 /*JP
1948             Your("skin returns to its original form.");
1949 */
1950             Your("\94ç\95\86\82Í\96{\97\88\82Ì\8ep\82É\96ß\82Á\82½\81D");
1951         uarm = uskin;
1952         uskin = (struct obj *) 0;
1953         /* undo save/restore hack */
1954         uarm->owornmask &= ~I_SPECIAL;
1955     }
1956 }
1957
1958 const char *
1959 mbodypart(mon, part)
1960 struct monst *mon;
1961 int part;
1962 {
1963     static NEARDATA const char
1964 #if 0 /*JP*/
1965         *humanoid_parts[] = { "arm",       "eye",  "face",         "finger",
1966                               "fingertip", "foot", "hand",         "handed",
1967                               "head",      "leg",  "light headed", "neck",
1968                               "spine",     "toe",  "hair",         "blood",
1969                               "lung",      "nose", "stomach" },
1970 #else
1971         *humanoid_parts[] = { "\98r", "\96Ú", "\8aç", "\8ew",
1972             "\8ew\90æ", "\91«", "\8eè", "\8eè\82É\82·\82é",
1973             "\93ª", "\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
1974             "\94w\8d\9c", "\92Ü\90æ", "\94¯",  "\8c\8c",
1975             "\94x", "\95@", "\88Ý"},
1976 #endif
1977 #if 0 /*JP*/
1978         *jelly_parts[] = { "pseudopod", "dark spot", "front",
1979                            "pseudopod extension", "pseudopod extremity",
1980                            "pseudopod root", "grasp", "grasped",
1981                            "cerebral area", "lower pseudopod", "viscous",
1982                            "middle", "surface", "pseudopod extremity",
1983                            "ripples", "juices", "surface", "sensor",
1984                            "stomach" },
1985 #else
1986     *jelly_parts[] = { "\8b[\8e\97\90G\8eè", "\8d\95\82¢\94Á\93_", "\91O\96Ê",
1987         "\8b[\8e\97\90G\8eè\82Ì\90æ", "\8b[\8e\97\90G\8eè",
1988         "\8b[\8e\97\90G\8eè\82Ì\8a²", "\90G\8eè", "\88¬\82é",
1989         "\94]\82Ì\97Ì\88æ", "\89º\95û\82Ì\8b[\8e\97\90G\8eè", "\82Ë\82Î\82Ë\82Î\82µ\82Ä\82«\82½",
1990         "\92\86\8aÔ\97Ì\88æ", "\95\\96Ê",  "\8b[\8e\97\90G\8eè",
1991         "\94g\96ä", "\91Ì\89t", "\95\\96Ê", "\8a´\8ao\8aí",
1992         "\88Ý"},
1993 #endif
1994 #if 0 /*JP*/
1995         *animal_parts[] = { "forelimb",  "eye",           "face",
1996                             "foreclaw",  "claw tip",      "rear claw",
1997                             "foreclaw",  "clawed",        "head",
1998                             "rear limb", "light headed",  "neck",
1999                             "spine",     "rear claw tip", "fur",
2000                             "blood",     "lung",          "nose",
2001                             "stomach" },
2002 #else
2003     *animal_parts[] = { "\91O\91«", "\96Ú", "\8aç",
2004         "\91O\92Ü", "\92Ü\90æ", "\8cã\92Ü",
2005         "\91O\92Ü", "\82Ð\82Á\82©\82¯\82é", "\93ª",
2006         "\8cã\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
2007         "\94w\8d\9c", "\8cã\92Ü\90æ", "\96Ñ\94ç",
2008         "\8c\8c", "\94x", "\95@",
2009         "\88Ý"},
2010 #endif
2011 #if 0 /*JP*/
2012         *bird_parts[] = { "wing",     "eye",  "face",         "wing",
2013                           "wing tip", "foot", "wing",         "winged",
2014                           "head",     "leg",  "light headed", "neck",
2015                           "spine",    "toe",  "feathers",     "blood",
2016                           "lung",     "bill", "stomach" },
2017 #else
2018     *bird_parts[] = { "\97\83", "\96Ú", "\8aç", "\97\83",
2019         "\97\83\82Ì\90æ", "\91«", "\97\83", "\97\83\82É\82Æ\82é",
2020         "\93ª", "\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
2021         "\94w\8d\9c", "\92Ü\90æ", "\89H\96Ñ", "\8c\8c",
2022         "\94x", "\82­\82¿\82Î\82µ", "\88Ý" },
2023 #endif
2024 #if 0 /*JP*/
2025         *horse_parts[] = { "foreleg",  "eye",           "face",
2026                            "forehoof", "hoof tip",      "rear hoof",
2027                            "forehoof", "hooved",        "head",
2028                            "rear leg", "light headed",  "neck",
2029                            "backbone", "rear hoof tip", "mane",
2030                            "blood",    "lung",          "nose",
2031                            "stomach" },
2032 #else
2033     *horse_parts[] = { "\91O\91«", "\96Ú", "\8aç",
2034         "\91O\92û", "\92û", "\8cã\92û",
2035         "\91O\92Ü", "\92û\82É\82Í\82³\82Þ", "\93ª",
2036         "\8cã\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
2037         "\94w\8d\9c", "\8cã\92Ü\90æ", "\82½\82Ä\82ª\82Ý",
2038         "\8c\8c", "\94x", "\95@",
2039         "\88Ý" },
2040 #endif
2041 #if 0 /*JP*/
2042         *sphere_parts[] = { "appendage", "optic nerve", "body", "tentacle",
2043                             "tentacle tip", "lower appendage", "tentacle",
2044                             "tentacled", "body", "lower tentacle",
2045                             "rotational", "equator", "body",
2046                             "lower tentacle tip", "cilia", "life force",
2047                             "retina", "olfactory nerve", "interior" },
2048 #else
2049         *sphere_parts[] = { "\93Ë\8bN", "\8e\8b\8ao\90_\8co", "\91Ì", "\90G\8eè",
2050             "\90G\8eè\82Ì\90æ", "\89º\82Ì\93Ë\8bN", "\90G\8eè",
2051             "\90G\8eè\82É\8e\9d\82Â", "\91Ì", "\89º\82Ì\90G\8eè",
2052             "\89ñ\93]\82µ\82½", "\92\86\90S\90ü", "\91Ì",
2053             "\89º\82Ì\90G\8eè\82Ì\90æ", "\91@\96Ñ", "\90\96½\97Í",
2054             "\96Ô\96\8c", "\9ak\8ao\92\86\90\95", "\93à\95\94" },
2055 #endif
2056 #if 0 /*JP*/
2057         *fungus_parts[] = { "mycelium", "visual area", "front",
2058                             "hypha",    "hypha",       "root",
2059                             "strand",   "stranded",    "cap area",
2060                             "rhizome",  "sporulated",  "stalk",
2061                             "root",     "rhizome tip", "spores",
2062                             "juices",   "gill",        "gill",
2063                             "interior" },
2064 #else
2065         *fungus_parts[] = { "\8bÛ\8e\85\91Ì", "\8e\8b\8ao\97Ì\88æ", "\91O",
2066             "\8bÛ\8e\85", "\8bÛ\8e\85", "\8dª",
2067             "\90G\8eè", "\90G\8eè\82É\82©\82ç\82Ý\82Â\82¯\82é", "\8eP",
2068             "\8dª\8cs", "\8d¬\97\90\82·\82é", "\8e²",
2069             "\8dª", "\8dª\8cs\82Ì\90æ", "\89è\96E",
2070             "\91Ì\89t", "\82¦\82ç", "\82¦\82ç",
2071             "\93à\95\94"},
2072 #endif
2073 #if 0 /*JP*/
2074         *vortex_parts[] = { "region",        "eye",           "front",
2075                             "minor current", "minor current", "lower current",
2076                             "swirl",         "swirled",       "central core",
2077                             "lower current", "addled",        "center",
2078                             "currents",      "edge",          "currents",
2079                             "life force",    "center",        "leading edge",
2080                             "interior" },
2081 #else
2082         *vortex_parts[] = { "\97Ì\88æ", "\96Ú", "\91O",
2083             "\8f¬\82³\82¢\97¬\82ê", "\8f¬\82³\82¢\97¬\82ê", "\89º\95\94\82Ì\97¬\82ê",
2084             "\89Q\8aª", "\89Q\82É\8aª\82­", "\89Q\82Ì\92\86\90S",
2085             "\89º\95\94\82Ì\97¬\82ê", "\8d¬\97\90\82µ\82½", "\92\86\90S\95\94",
2086             "\97¬\82ê", "\8aO\8eü", "\8bC\97¬",
2087             "\90\96½\97Í", "\92\86\90S", "\91O\89\8f",
2088             "\93à\95\94" },
2089 #endif
2090 #if 0 /*JP*/
2091         *snake_parts[] = { "vestigial limb", "eye", "face", "large scale",
2092                            "large scale tip", "rear region", "scale gap",
2093                            "scale gapped", "head", "rear region",
2094                            "light headed", "neck", "length", "rear scale",
2095                            "scales", "blood", "lung", "forked tongue",
2096                            "stomach" },
2097 #else
2098         *snake_parts[] = { "\91Þ\89»\82µ\82½\91«", "\96Ú", "\8aç", "\91å\82«\82È\97Ø",
2099             "\91å\82«\82È\97Ø\82Ì\90æ", "\8cã\95\94\95ª", "\97Ø\82Ì\8c\84\8aÔ",
2100             "\97Ø\82Ì\8c\84\8aÔ\82É\82Â\82¯\82é", "\93ª", "\8cã\95\94\95ª",
2101             "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ", "\91Ì", "\8cã\95\94\95ª\82Ì\8aZ",
2102             "\97Ø", "\8c\8c", "\94x", "\90ã",
2103             "\88Ý" },
2104 #endif
2105 #if 0 /*JP*/
2106         *worm_parts[] = { "anterior segment", "light sensitive cell",
2107                           "clitellum", "setae", "setae", "posterior segment",
2108                           "segment", "segmented", "anterior segment",
2109                           "posterior", "over stretched", "clitellum",
2110                           "length", "posterior setae", "setae", "blood",
2111                           "skin", "prostomium", "stomach" },
2112 #else
2113         *worm_parts[] = { "\91O\8bæ", "\8a´\8cõ\90«\8d×\96E",
2114                           "\8aÂ\91Ñ", "\8ap", "\8ap", "\8cã\8bæ",
2115                           "\90ß", "\90ß\82É\82Â\82¯\82é", "\91O\8bæ",
2116                           "\8cã\95\94", "\90L\82Ñ\82·\82¬\82½", "\8aÂ\91Ñ",
2117                           "\91Ì", "\8cã\95\94\82Ì\8ap", "\8ap", "\8c\8c",
2118                           "\94ç\95\86", "\8cû\91O\97t", "\88Ý" },
2119 #endif
2120 #if 0 /*JP*/
2121         *fish_parts[] = { "fin", "eye", "premaxillary", "pelvic axillary",
2122                           "pelvic fin", "anal fin", "pectoral fin", "finned",
2123                           "head", "peduncle", "played out", "gills",
2124                           "dorsal fin", "caudal fin", "scales", "blood",
2125                           "gill", "nostril", "stomach" };
2126 #else
2127         *fish_parts[] = { "\82Ð\82ê", "\96Ú", "\8aç", "\82Ð\82ê\82Ì\90æ",
2128             "\82Ð\82ê\82Ì\90æ", "\94ö\82Ñ\82ê", "\8b¹\82Ð\82ê", "\82Ð\82ê\82Å\8e\9d\82Â",
2129             "\93ª", "\94ö\95¿", "\82ß\82Ü\82¢\82ª\82µ\82½", "\82¦\82ç",
2130             "\94w\82Ñ\82ê", "\94ö\82Ñ\82ê", "\97Ø", "\8c\8c",
2131             "\82¦\82ç", "\95@", "\88Ý" };
2132 #endif
2133 #if 0 /*JP*//*\8eg\82í\82È\82¢*/
2134     /* claw attacks are overloaded in mons[]; most humanoids with
2135        such attacks should still reference hands rather than claws */
2136     static const char not_claws[] = {
2137         S_HUMAN,     S_MUMMY,   S_ZOMBIE, S_ANGEL, S_NYMPH, S_LEPRECHAUN,
2138         S_QUANTMECH, S_VAMPIRE, S_ORC,    S_GIANT, /* quest nemeses */
2139         '\0' /* string terminator; assert( S_xxx != 0 ); */
2140     };
2141 #endif
2142     struct permonst *mptr = mon->data;
2143
2144 #if 0 /*JP*/
2145 /* paw\82Í\8c¢\82Æ\82©\94L\82Ì\8eè\81Cclaw\82Í\83^\83J\82Ì\91«\82Ì\82æ\82¤\82È\82©\82¬\82Â\82ß\81C
2146    \82Ç\82¿\82ç\82à\93ú\96{\8cê\82\82á\81u\8eè\81v\82Å\82¢\82¢\82Å\82µ\82å\82¤\81D
2147 */
2148     /* some special cases */
2149     if (mptr->mlet == S_DOG || mptr->mlet == S_FELINE
2150         || mptr->mlet == S_RODENT || mptr == &mons[PM_OWLBEAR]) {
2151         switch (part) {
2152         case HAND:
2153             return "paw";
2154         case HANDED:
2155             return "pawed";
2156         case FOOT:
2157             return "rear paw";
2158         case ARM:
2159         case LEG:
2160             return horse_parts[part]; /* "foreleg", "rear leg" */
2161         default:
2162             break; /* for other parts, use animal_parts[] below */
2163         }
2164     } else if (mptr->mlet == S_YETI) { /* excl. owlbear due to 'if' above */
2165         /* opposable thumbs, hence "hands", "arms", "legs", &c */
2166         return humanoid_parts[part]; /* yeti/sasquatch, monkey/ape */
2167     }
2168     if ((part == HAND || part == HANDED)
2169         && (humanoid(mptr) && attacktype(mptr, AT_CLAW)
2170             && !index(not_claws, mptr->mlet) && mptr != &mons[PM_STONE_GOLEM]
2171             && mptr != &mons[PM_INCUBUS] && mptr != &mons[PM_SUCCUBUS]))
2172         return (part == HAND) ? "claw" : "clawed";
2173 #endif
2174 #if 0 /*JP*//*trunk\82Í\8fÛ\82Ì\95@\82ð\88Ó\96¡\82·\82é\82»\82¤\82Å\82·\81B\93ú\96{\8cê\82Å\82Í\92P\82É\95@\82Å\82¢\82¢\82©\82Æ\81B*/
2175     if ((mptr == &mons[PM_MUMAK] || mptr == &mons[PM_MASTODON])
2176         && part == NOSE)
2177         return "trunk";
2178 #endif
2179     if (mptr == &mons[PM_SHARK] && part == HAIR)
2180 #if 0 /*JP*/
2181         return "skin"; /* sharks don't have scales */
2182 #else
2183         return "\93ª"; /* sharks don't have scales */
2184 #endif
2185     if ((mptr == &mons[PM_JELLYFISH] || mptr == &mons[PM_KRAKEN])
2186         && (part == ARM || part == FINGER || part == HAND || part == FOOT
2187             || part == TOE))
2188 /*JP
2189         return "tentacle";
2190 */
2191         return "\90G\8eè";
2192     if (mptr == &mons[PM_FLOATING_EYE] && part == EYE)
2193 /*JP
2194         return "cornea";
2195 */
2196         return "\8ap\96\8c";
2197     if (humanoid(mptr) && (part == ARM || part == FINGER || part == FINGERTIP
2198                            || part == HAND || part == HANDED))
2199         return humanoid_parts[part];
2200     if (mptr == &mons[PM_RAVEN])
2201         return bird_parts[part];
2202     if (mptr->mlet == S_CENTAUR || mptr->mlet == S_UNICORN
2203         || (mptr == &mons[PM_ROTHE] && part != HAIR))
2204         return horse_parts[part];
2205     if (mptr->mlet == S_LIGHT) {
2206 #if 0 /*JP*/
2207         if (part == HANDED)
2208             return "rayed";
2209         else if (part == ARM || part == FINGER || part == FINGERTIP
2210                  || part == HAND)
2211             return "ray";
2212         else
2213             return "beam";
2214 #else
2215         if (part == HANDED || part == ARM || part == FINGER
2216             || part == FINGERTIP || part == HAND) {
2217             return "\8cõ";
2218         }
2219 #endif
2220     }
2221     if (mptr == &mons[PM_STALKER] && part == HEAD)
2222 /*JP
2223         return "head";
2224 */
2225         return "\93ª";
2226     if (mptr->mlet == S_EEL && mptr != &mons[PM_JELLYFISH])
2227         return fish_parts[part];
2228     if (mptr->mlet == S_WORM)
2229         return worm_parts[part];
2230     if (slithy(mptr) || (mptr->mlet == S_DRAGON && part == HAIR))
2231         return snake_parts[part];
2232     if (mptr->mlet == S_EYE)
2233         return sphere_parts[part];
2234     if (mptr->mlet == S_JELLY || mptr->mlet == S_PUDDING
2235         || mptr->mlet == S_BLOB || mptr == &mons[PM_JELLYFISH])
2236         return jelly_parts[part];
2237     if (mptr->mlet == S_VORTEX || mptr->mlet == S_ELEMENTAL)
2238         return vortex_parts[part];
2239     if (mptr->mlet == S_FUNGUS)
2240         return fungus_parts[part];
2241     if (humanoid(mptr))
2242         return humanoid_parts[part];
2243     return animal_parts[part];
2244 }
2245
2246 const char *
2247 body_part(part)
2248 int part;
2249 {
2250     return mbodypart(&youmonst, part);
2251 }
2252
2253 int
2254 poly_gender()
2255 {
2256     /* Returns gender of polymorphed player;
2257      * 0/1=same meaning as flags.female, 2=none.
2258      */
2259     if (is_neuter(youmonst.data) || !humanoid(youmonst.data))
2260         return 2;
2261     return flags.female;
2262 }
2263
2264 void
2265 ugolemeffects(damtype, dam)
2266 int damtype, dam;
2267 {
2268     int heal = 0;
2269
2270     /* We won't bother with "slow"/"haste" since players do not
2271      * have a monster-specific slow/haste so there is no way to
2272      * restore the old velocity once they are back to human.
2273      */
2274     if (u.umonnum != PM_FLESH_GOLEM && u.umonnum != PM_IRON_GOLEM)
2275         return;
2276     switch (damtype) {
2277     case AD_ELEC:
2278         if (u.umonnum == PM_FLESH_GOLEM)
2279             heal = (dam + 5) / 6; /* Approx 1 per die */
2280         break;
2281     case AD_FIRE:
2282         if (u.umonnum == PM_IRON_GOLEM)
2283             heal = dam;
2284         break;
2285     }
2286     if (heal && (u.mh < u.mhmax)) {
2287         u.mh += heal;
2288         if (u.mh > u.mhmax)
2289             u.mh = u.mhmax;
2290         context.botl = 1;
2291 /*JP
2292         pline("Strangely, you feel better than before.");
2293 */
2294         pline("\8aï\96­\82È\82±\82Æ\82É\81C\91O\82æ\82è\8bC\95ª\82ª\82æ\82­\82È\82Á\82½\81D");
2295         exercise(A_STR, TRUE);
2296     }
2297 }
2298
2299 STATIC_OVL int
2300 armor_to_dragon(atyp)
2301 int atyp;
2302 {
2303     switch (atyp) {
2304     case GRAY_DRAGON_SCALE_MAIL:
2305     case GRAY_DRAGON_SCALES:
2306         return PM_GRAY_DRAGON;
2307     case SILVER_DRAGON_SCALE_MAIL:
2308     case SILVER_DRAGON_SCALES:
2309         return PM_SILVER_DRAGON;
2310 #if 0 /* DEFERRED */
2311     case SHIMMERING_DRAGON_SCALE_MAIL:
2312     case SHIMMERING_DRAGON_SCALES:
2313         return PM_SHIMMERING_DRAGON;
2314 #endif
2315     case RED_DRAGON_SCALE_MAIL:
2316     case RED_DRAGON_SCALES:
2317         return PM_RED_DRAGON;
2318     case ORANGE_DRAGON_SCALE_MAIL:
2319     case ORANGE_DRAGON_SCALES:
2320         return PM_ORANGE_DRAGON;
2321     case WHITE_DRAGON_SCALE_MAIL:
2322     case WHITE_DRAGON_SCALES:
2323         return PM_WHITE_DRAGON;
2324     case BLACK_DRAGON_SCALE_MAIL:
2325     case BLACK_DRAGON_SCALES:
2326         return PM_BLACK_DRAGON;
2327     case BLUE_DRAGON_SCALE_MAIL:
2328     case BLUE_DRAGON_SCALES:
2329         return PM_BLUE_DRAGON;
2330     case GREEN_DRAGON_SCALE_MAIL:
2331     case GREEN_DRAGON_SCALES:
2332         return PM_GREEN_DRAGON;
2333     case YELLOW_DRAGON_SCALE_MAIL:
2334     case YELLOW_DRAGON_SCALES:
2335         return PM_YELLOW_DRAGON;
2336     default:
2337         return -1;
2338     }
2339 }
2340
2341 /*
2342  * Some species have awareness of other species
2343  */
2344 static boolean
2345 polysense(mptr)
2346 struct permonst *mptr;
2347 {
2348     short warnidx = 0;
2349
2350     context.warntype.speciesidx = 0;
2351     context.warntype.species = 0;
2352     context.warntype.polyd = 0;
2353
2354     switch (monsndx(mptr)) {
2355     case PM_PURPLE_WORM:
2356         warnidx = PM_SHRIEKER;
2357         break;
2358     case PM_VAMPIRE:
2359     case PM_VAMPIRE_LORD:
2360         context.warntype.polyd = M2_HUMAN | M2_ELF;
2361         HWarn_of_mon |= FROMRACE;
2362         return TRUE;
2363     }
2364     if (warnidx) {
2365         context.warntype.speciesidx = warnidx;
2366         context.warntype.species = &mons[warnidx];
2367         HWarn_of_mon |= FROMRACE;
2368         return TRUE;
2369     }
2370     context.warntype.speciesidx = 0;
2371     context.warntype.species = 0;
2372     HWarn_of_mon &= ~FROMRACE;
2373     return FALSE;
2374 }
2375
2376 /*polyself.c*/