OSDN Git Service

eliminate warnings
[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 #if 0 /*JP*/
545                     char *p, *dsmail;
546 #else
547                     char *dsmail;
548 #endif
549
550                     /* similar to noarmor(invent.c),
551                        shorten to "<color> scale mail" */
552                     dsmail = strcpy(buf, simpleonames(uarm));
553 #if 0 /*JP*/
554                     if ((p = strstri(dsmail, " dragon ")) != 0)
555                         while ((p[1] = p[8]) != '\0')
556                             ++p;
557 #endif
558                     /* tricky phrasing; dragon scale mail
559                        is singular, dragon scales are plural */
560 #if 0 /*JP*/
561                     Your("%s reverts to scales as you merge with them.",
562                          dsmail);
563 #else
564                     Your("%s\82Í\97Ø\82É\96ß\82Á\82½\81D",
565                          dsmail);
566 #endif
567                     /* uarm->spe enchantment remains unchanged;
568                        re-converting scales to mail poses risk
569                        of evaporation due to over enchanting */
570                     uarm->otyp += GRAY_DRAGON_SCALES - GRAY_DRAGON_SCALE_MAIL;
571                     uarm->dknown = 1;
572                     context.botl = 1; /* AC is changing */
573                 }
574                 uskin = uarm;
575                 uarm = (struct obj *) 0;
576                 /* save/restore hack */
577                 uskin->owornmask |= I_SPECIAL;
578                 update_inventory();
579             }
580         } else if (iswere) {
581         do_shift:
582             if (Upolyd && were_beastie(mntmp) != u.ulycn)
583                 mntmp = PM_HUMAN; /* Illegal; force newman() */
584             else
585                 mntmp = u.ulycn;
586         } else if (isvamp) {
587         do_vampyr:
588             if (mntmp < LOW_PM || (mons[mntmp].geno & G_UNIQ))
589                 mntmp = (youmonst.data != &mons[PM_VAMPIRE] && !rn2(10))
590                             ? PM_WOLF
591                             : !rn2(4) ? PM_FOG_CLOUD : PM_VAMPIRE_BAT;
592             if (controllable_poly) {
593 /*JP
594                 Sprintf(buf, "Become %s?", an(mons[mntmp].mname));
595 */
596                 Sprintf(buf, "%s\82É\82È\82é\81H", mons[mntmp].mname);
597                 if (yn(buf) != 'y')
598                     return;
599             }
600         }
601         /* if polymon fails, "you feel" message has been given
602            so don't follow up with another polymon or newman;
603            sex_change_ok left disabled here */
604         if (mntmp == PM_HUMAN)
605             newman(); /* werecritter */
606         else
607             (void) polymon(mntmp);
608         goto made_change; /* maybe not, but this is right anyway */
609     }
610
611     if (mntmp < LOW_PM) {
612         tryct = 200;
613         do {
614             /* randomly pick an "ordinary" monster */
615             mntmp = rn1(SPECIAL_PM - LOW_PM, LOW_PM);
616             if (polyok(&mons[mntmp]) && !is_placeholder(&mons[mntmp]))
617                 break;
618         } while (--tryct > 0);
619     }
620
621     /* The below polyok() fails either if everything is genocided, or if
622      * we deliberately chose something illegal to force newman().
623      */
624     sex_change_ok++;
625     if (!polyok(&mons[mntmp]) || (!forcecontrol && !rn2(5))
626         || your_race(&mons[mntmp])) {
627         newman();
628     } else {
629         (void) polymon(mntmp);
630     }
631     sex_change_ok--; /* reset */
632
633 made_change:
634     new_light = emits_light(youmonst.data);
635     if (old_light != new_light) {
636         if (old_light)
637             del_light_source(LS_MONSTER, monst_to_any(&youmonst));
638         if (new_light == 1)
639             ++new_light; /* otherwise it's undetectable */
640         if (new_light)
641             new_light_source(u.ux, u.uy, new_light, LS_MONSTER,
642                              monst_to_any(&youmonst));
643     }
644 }
645
646 /* (try to) make a mntmp monster out of the player;
647    returns 1 if polymorph successful */
648 int
649 polymon(mntmp)
650 int mntmp;
651 {
652     boolean sticky = sticks(youmonst.data) && u.ustuck && !u.uswallow,
653             was_blind = !!Blind, dochange = FALSE;
654     int mlvl;
655
656     if (mvitals[mntmp].mvflags & G_GENOD) { /* allow G_EXTINCT */
657 /*JP
658         You_feel("rather %s-ish.", mons[mntmp].mname);
659 */
660         You("%s\82Á\82Û\82­\82È\82Á\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81D", mons[mntmp].mname);
661         exercise(A_WIS, TRUE);
662         return 0;
663     }
664
665     /* KMH, conduct */
666     u.uconduct.polyselfs++;
667
668     /* exercise used to be at the very end but only Wis was affected
669        there since the polymorph was always in effect by then */
670     exercise(A_CON, FALSE);
671     exercise(A_WIS, TRUE);
672
673     if (!Upolyd) {
674         /* Human to monster; save human stats */
675         u.macurr = u.acurr;
676         u.mamax = u.amax;
677         u.mfemale = flags.female;
678     } else {
679         /* Monster to monster; restore human stats, to be
680          * immediately changed to provide stats for the new monster
681          */
682         u.acurr = u.macurr;
683         u.amax = u.mamax;
684         flags.female = u.mfemale;
685     }
686
687     /* if stuck mimicking gold, stop immediately */
688     if (multi < 0 && youmonst.m_ap_type == M_AP_OBJECT
689         && youmonst.data->mlet != S_MIMIC)
690         unmul("");
691     /* if becoming a non-mimic, stop mimicking anything */
692     if (mons[mntmp].mlet != S_MIMIC) {
693         /* as in polyman() */
694         youmonst.m_ap_type = M_AP_NOTHING;
695     }
696     if (is_male(&mons[mntmp])) {
697         if (flags.female)
698             dochange = TRUE;
699     } else if (is_female(&mons[mntmp])) {
700         if (!flags.female)
701             dochange = TRUE;
702     } else if (!is_neuter(&mons[mntmp]) && mntmp != u.ulycn) {
703         if (sex_change_ok && !rn2(10))
704             dochange = TRUE;
705     }
706     if (dochange) {
707         flags.female = !flags.female;
708 #if 0 /*JP*/
709         You("%s %s%s!",
710             (u.umonnum != mntmp) ? "turn into a" : "feel like a new",
711             (is_male(&mons[mntmp]) || is_female(&mons[mntmp]))
712                 ? ""
713                 : flags.female ? "female " : "male ",
714             mons[mntmp].mname);
715 #else
716         You("%s%s\82É\82È\82Á\82½%s\81I",
717             (is_male(&mons[mntmp]) || is_female(&mons[mntmp]))
718                 ? ""
719                 : flags.female ? "\8f\97\82Ì" : "\92j\82Ì",
720             mons[mntmp].mname,
721             (u.umonnum != mntmp) ? "" : "\82æ\82¤\82È\8bC\82ª\82µ\82½");
722 #endif
723     } else {
724         if (u.umonnum != mntmp)
725 /*JP
726             You("turn into %s!", an(mons[mntmp].mname));
727 */
728             You("%s\82É\82È\82Á\82½\81I", mons[mntmp].mname);
729         else
730 /*JP
731             You_feel("like a new %s!", mons[mntmp].mname);
732 */
733             You("\95Ê\82Ì%s\82É\82È\82Á\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81I", mons[mntmp].mname);
734     }
735     if (Stoned && poly_when_stoned(&mons[mntmp])) {
736         /* poly_when_stoned already checked stone golem genocide */
737         mntmp = PM_STONE_GOLEM;
738 /*JP
739         make_stoned(0L, "You turn to stone!", 0, (char *) 0);
740 */
741         make_stoned(0L, "\90Î\82É\82È\82Á\82½\81I", 0, (char *) 0);
742     }
743
744     u.mtimedone = rn1(500, 500);
745     u.umonnum = mntmp;
746     set_uasmon();
747
748     /* New stats for monster, to last only as long as polymorphed.
749      * Currently only strength gets changed.
750      */
751     if (strongmonst(&mons[mntmp]))
752         ABASE(A_STR) = AMAX(A_STR) = STR18(100);
753
754     if (Stone_resistance && Stoned) { /* parnes@eniac.seas.upenn.edu */
755 /*JP
756         make_stoned(0L, "You no longer seem to be petrifying.", 0,
757 */
758         make_stoned(0L, "\90Î\89»\82©\82ç\89ð\95ú\82³\82ê\82½\82æ\82¤\82¾\81D", 0,
759                     (char *) 0);
760     }
761     if (Sick_resistance && Sick) {
762         make_sick(0L, (char *) 0, FALSE, SICK_ALL);
763 /*JP
764         You("no longer feel sick.");
765 */
766         You("\95a\8bC\82©\82ç\89ð\95ú\82³\82ê\82½\82æ\82¤\82¾\81D");
767     }
768     if (Slimed) {
769         if (flaming(youmonst.data)) {
770 /*JP
771             make_slimed(0L, "The slime burns away!");
772 */
773             make_slimed(0L, "\83X\83\89\83C\83\80\82Í\94R\82¦\82½\81I");
774         } else if (mntmp == PM_GREEN_SLIME) {
775             /* do it silently */
776             make_slimed(0L, (char *) 0);
777         }
778     }
779     check_strangling(FALSE); /* maybe stop strangling */
780     if (nohands(youmonst.data))
781         Glib = 0;
782
783     /*
784     mlvl = adj_lev(&mons[mntmp]);
785      * We can't do the above, since there's no such thing as an
786      * "experience level of you as a monster" for a polymorphed character.
787      */
788     mlvl = (int) mons[mntmp].mlevel;
789     if (youmonst.data->mlet == S_DRAGON && mntmp >= PM_GRAY_DRAGON) {
790         u.mhmax = In_endgame(&u.uz) ? (8 * mlvl) : (4 * mlvl + d(mlvl, 4));
791     } else if (is_golem(youmonst.data)) {
792         u.mhmax = golemhp(mntmp);
793     } else {
794         if (!mlvl)
795             u.mhmax = rnd(4);
796         else
797             u.mhmax = d(mlvl, 8);
798         if (is_home_elemental(&mons[mntmp]))
799             u.mhmax *= 3;
800     }
801     u.mh = u.mhmax;
802
803     if (u.ulevel < mlvl) {
804         /* Low level characters can't become high level monsters for long */
805 #ifdef DUMB
806         /* DRS/NS 2.2.6 messes up -- Peter Kendell */
807         int mtd = u.mtimedone, ulv = u.ulevel;
808
809         u.mtimedone = mtd * ulv / mlvl;
810 #else
811         u.mtimedone = u.mtimedone * u.ulevel / mlvl;
812 #endif
813     }
814
815     if (uskin && mntmp != armor_to_dragon(uskin->otyp))
816         skinback(FALSE);
817     break_armor();
818     drop_weapon(1);
819     (void) hideunder(&youmonst);
820
821     if (u.utraptype == TT_PIT && u.utrap) {
822         u.utrap = rn1(6, 2); /* time to escape resets */
823     }
824     if (was_blind && !Blind) { /* previous form was eyeless */
825         Blinded = 1L;
826         make_blinded(0L, TRUE); /* remove blindness */
827     }
828     newsym(u.ux, u.uy); /* Change symbol */
829
830     if (!sticky && !u.uswallow && u.ustuck && sticks(youmonst.data))
831         u.ustuck = 0;
832     else if (sticky && !sticks(youmonst.data))
833         uunstick();
834     if (u.usteed) {
835         if (touch_petrifies(u.usteed->data) && !Stone_resistance && rnl(3)) {
836             char buf[BUFSZ];
837
838 #if 0 /*JP*/
839             pline("%s touch %s.", no_longer_petrify_resistant,
840                   mon_nam(u.usteed));
841 #else
842             pline("%s\82Í%s\82É\90G\82ê\82½\81D", no_longer_petrify_resistant,
843                   mon_nam(u.usteed));
844 #endif
845 /*JP
846             Sprintf(buf, "riding %s", an(u.usteed->data->mname));
847 */
848             Sprintf(buf, "%s\82É\8fæ\82Á\82Ä", u.usteed->data->mname);
849             instapetrify(buf);
850         }
851         if (!can_ride(u.usteed))
852             dismount_steed(DISMOUNT_POLY);
853     }
854
855     if (flags.verbose) {
856 /*JP
857         static const char use_thec[] = "Use the command #%s to %s.";
858 */
859         static const char use_thec[] = "#%s\83R\83}\83\93\83h\82Å%s\82±\82Æ\82ª\82Å\82«\82é\81D";
860         static const char monsterc[] = "monster";
861
862         if (can_breathe(youmonst.data))
863 /*JP
864             pline(use_thec, monsterc, "use your breath weapon");
865 */
866             pline(use_thec,monsterc, "\91§\82ð\93f\82«\82©\82¯\82é");
867         if (attacktype(youmonst.data, AT_SPIT))
868 /*JP
869             pline(use_thec, monsterc, "spit venom");
870 */
871             pline(use_thec,monsterc, "\93Å\82ð\93f\82­");
872         if (youmonst.data->mlet == S_NYMPH)
873 /*JP
874             pline(use_thec, monsterc, "remove an iron ball");
875 */
876             pline(use_thec,monsterc, "\93S\8b\85\82ð\82Í\82¸\82·");
877         if (attacktype(youmonst.data, AT_GAZE))
878 /*JP
879             pline(use_thec, monsterc, "gaze at monsters");
880 */
881             pline(use_thec,monsterc, "\89ö\95¨\82ðáÉ\82Þ");
882         if (is_hider(youmonst.data))
883 /*JP
884             pline(use_thec, monsterc, "hide");
885 */
886             pline(use_thec,monsterc, "\89B\82ê\82é");
887         if (is_were(youmonst.data))
888 /*JP
889             pline(use_thec, monsterc, "summon help");
890 */
891             pline(use_thec,monsterc, "\92\87\8aÔ\82ð\8f¢\8a«\82·\82é");
892         if (webmaker(youmonst.data))
893 /*JP
894             pline(use_thec, monsterc, "spin a web");
895 */
896             pline(use_thec,monsterc, "\82­\82à\82Ì\91\83\82ð\92£\82é");
897         if (u.umonnum == PM_GREMLIN)
898 /*JP
899             pline(use_thec, monsterc, "multiply in a fountain");
900 */
901             pline(use_thec,monsterc, "\90ò\82Ì\92\86\82Å\95ª\97ô\82·\82é");
902         if (is_unicorn(youmonst.data))
903 /*JP
904             pline(use_thec, monsterc, "use your horn");
905 */
906             pline(use_thec,monsterc, "\8ap\82ð\8eg\82¤");
907         if (is_mind_flayer(youmonst.data))
908 /*JP
909             pline(use_thec, monsterc, "emit a mental blast");
910 */
911             pline(use_thec,monsterc, "\90¸\90_\94g\82ð\94­\90\82³\82¹\82é");
912         if (youmonst.data->msound == MS_SHRIEK) /* worthless, actually */
913 /*JP
914             pline(use_thec, monsterc, "shriek");
915 */
916             pline(use_thec,monsterc, "\8bà\90Ø\82è\90º\82ð\82 \82°\82é");
917         if (is_vampire(youmonst.data))
918 /*JP
919             pline(use_thec, monsterc, "change shape");
920 */
921             pline(use_thec, monsterc, "\8ep\82ð\95Ï\82¦\82é");
922
923         if (lays_eggs(youmonst.data) && flags.female)
924 /*JP
925             pline(use_thec, "sit", "lay an egg");
926 */
927             pline(use_thec, "sit", "\97\91\82ð\8eY\82Þ");
928     }
929
930     /* you now know what an egg of your type looks like */
931     if (lays_eggs(youmonst.data)) {
932         learn_egg_type(u.umonnum);
933         /* make queen bees recognize killer bee eggs */
934         learn_egg_type(egg_type_from_parent(u.umonnum, TRUE));
935     }
936     find_ac();
937     if ((!Levitation && !u.ustuck && !Flying && is_pool_or_lava(u.ux, u.uy))
938         || (Underwater && !Swimming))
939         spoteffects(TRUE);
940     if (Passes_walls && u.utrap
941         && (u.utraptype == TT_INFLOOR || u.utraptype == TT_BURIEDBALL)) {
942         u.utrap = 0;
943         if (u.utraptype == TT_INFLOOR)
944 /*JP
945             pline_The("rock seems to no longer trap you.");
946 */
947             pline("\8aâ\82É\95Â\82\8d\9e\82ß\82ç\82ê\82é\82±\82Æ\82Í\82È\82¢\82¾\82ë\82¤\81D");
948         else {
949 /*JP
950             pline_The("buried ball is no longer bound to you.");
951 */
952             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");
953             buried_ball_to_freedom();
954         }
955     } else if (likes_lava(youmonst.data) && u.utrap
956                && u.utraptype == TT_LAVA) {
957         u.utrap = 0;
958 /*JP
959         pline_The("lava now feels soothing.");
960 */
961         pline("\97n\8aâ\82ª\90¸\90_\82ð\97\8e\82¿\82Â\82©\82¹\82Ä\82­\82ê\82é\81D");
962     }
963     if (amorphous(youmonst.data) || is_whirly(youmonst.data)
964         || unsolid(youmonst.data)) {
965         if (Punished) {
966 /*JP
967             You("slip out of the iron chain.");
968 */
969             You("\93S\82Ì\8d½\82©\82ç\82·\82é\82è\82Æ\94²\82¯\82½\81D");
970             unpunish();
971         } else if (u.utrap && u.utraptype == TT_BURIEDBALL) {
972 /*JP
973             You("slip free of the buried ball and chain.");
974 */
975             You("\96\84\82Ü\82Á\82Ä\82¢\82é\8b\85\82Æ\8d½\82©\82ç\82·\82é\82è\82Æ\94²\82¯\82½\81D");
976             buried_ball_to_freedom();
977         }
978     }
979     if (u.utrap && (u.utraptype == TT_WEB || u.utraptype == TT_BEARTRAP)
980         && (amorphous(youmonst.data) || is_whirly(youmonst.data)
981             || unsolid(youmonst.data) || (youmonst.data->msize <= MZ_SMALL
982                                           && u.utraptype == TT_BEARTRAP))) {
983 #if 0 /*JP*/
984         You("are no longer stuck in the %s.",
985             u.utraptype == TT_WEB ? "web" : "bear trap");
986 #else
987         You("%s\82©\82ç\92E\8fo\82µ\82½\81D",
988             u.utraptype == TT_WEB ? "\82­\82à\82Ì\91\83" : "\8cF\82Ìã©");
989 #endif
990         /* probably should burn webs too if PM_FIRE_ELEMENTAL */
991         u.utrap = 0;
992     }
993     if (webmaker(youmonst.data) && u.utrap && u.utraptype == TT_WEB) {
994 /*JP
995         You("orient yourself on the web.");
996 */
997         You("\82­\82à\82Ì\91\83\82É\93K\89\9e\82µ\82½\81D");
998         u.utrap = 0;
999     }
1000     check_strangling(TRUE); /* maybe start strangling */
1001     (void) polysense(youmonst.data);
1002
1003     context.botl = 1;
1004     vision_full_recalc = 1;
1005     see_monsters();
1006     (void) encumber_msg();
1007
1008     retouch_equipment(2);
1009     /* this might trigger a recursive call to polymon() [stone golem
1010        wielding cockatrice corpse and hit by stone-to-flesh, becomes
1011        flesh golem above, now gets transformed back into stone golem] */
1012     if (!uarmg)
1013         selftouch(no_longer_petrify_resistant);
1014     return 1;
1015 }
1016
1017 STATIC_OVL void
1018 break_armor()
1019 {
1020     register struct obj *otmp;
1021
1022     if (breakarm(youmonst.data)) {
1023         if ((otmp = uarm) != 0) {
1024             if (donning(otmp))
1025                 cancel_don();
1026 /*JP
1027             You("break out of your armor!");
1028 */
1029             You("\8aZ\82ð\89ó\82µ\82½\81I");
1030             exercise(A_STR, FALSE);
1031             (void) Armor_gone();
1032             useup(otmp);
1033         }
1034         if ((otmp = uarmc) != 0) {
1035             if (otmp->oartifact) {
1036 /*JP
1037                 Your("%s falls off!", cloak_simple_name(otmp));
1038 */
1039                 Your("%s\82Í\92E\82°\97\8e\82¿\82½\81I", cloak_simple_name(otmp));
1040                 (void) Cloak_off();
1041                 dropx(otmp);
1042             } else {
1043 /*JP
1044                 Your("%s tears apart!", cloak_simple_name(otmp));
1045 */
1046                 Your("%s\82Í\82¸\82½\82¸\82½\82É\88ø\82«\97ô\82©\82ê\82½\81I", cloak_simple_name(otmp));
1047                 (void) Cloak_off();
1048                 useup(otmp);
1049             }
1050         }
1051         if (uarmu) {
1052 /*JP
1053             Your("shirt rips to shreds!");
1054 */
1055             Your("\83V\83\83\83c\82Í\88ø\82«\97ô\82©\82ê\82½\81I");
1056             useup(uarmu);
1057         }
1058     } else if (sliparm(youmonst.data)) {
1059         if (((otmp = uarm) != 0) && (racial_exception(&youmonst, otmp) < 1)) {
1060             if (donning(otmp))
1061                 cancel_don();
1062 /*JP
1063             Your("armor falls around you!");
1064 */
1065             Your("\8aZ\82Í\82 \82È\82½\82Ì\82Ü\82í\82è\82É\97\8e\82¿\82½\81I");
1066             (void) Armor_gone();
1067             dropx(otmp);
1068         }
1069         if ((otmp = uarmc) != 0) {
1070             if (is_whirly(youmonst.data))
1071 /*JP
1072                 Your("%s falls, unsupported!", cloak_simple_name(otmp));
1073 */
1074                 Your("%s\82Í\82·\82Æ\82ñ\82Æ\97\8e\82¿\82½\81I", cloak_simple_name(otmp));
1075             else
1076 /*JP
1077                 You("shrink out of your %s!", cloak_simple_name(otmp));
1078 */
1079                 You("%s\82©\82ç\8fk\82Ý\8fo\82½\81I", cloak_simple_name(otmp));
1080             (void) Cloak_off();
1081             dropx(otmp);
1082         }
1083         if ((otmp = uarmu) != 0) {
1084             if (is_whirly(youmonst.data))
1085 /*JP
1086                 You("seep right through your shirt!");
1087 */
1088                 You("\83V\83\83\83c\82©\82ç\82µ\82Ý\8fo\82½\81I");
1089             else
1090 /*JP
1091                 You("become much too small for your shirt!");
1092 */
1093                 You("\83V\83\83\83c\82æ\82è\82¸\82Á\82Æ\8f¬\82³\82­\82È\82Á\82½\81I");
1094             setworn((struct obj *) 0, otmp->owornmask & W_ARMU);
1095             dropx(otmp);
1096         }
1097     }
1098     if (has_horns(youmonst.data)) {
1099         if ((otmp = uarmh) != 0) {
1100             if (is_flimsy(otmp) && !donning(otmp)) {
1101 #if 0 /*JP*/
1102                 char hornbuf[BUFSZ];
1103
1104                 /* Future possibilities: This could damage/destroy helmet */
1105                 Sprintf(hornbuf, "horn%s", plur(num_horns(youmonst.data)));
1106                 Your("%s %s through %s.", hornbuf, vtense(hornbuf, "pierce"),
1107                      yname(otmp));
1108 #else
1109                 Your("\8ap\82ª%s\82ð\82Â\82ç\82Ê\82¢\82½\81D", yname(otmp));
1110 #endif
1111             } else {
1112                 if (donning(otmp))
1113                     cancel_don();
1114 #if 0 /*JP*/
1115                 Your("%s falls to the %s!", helm_simple_name(otmp),
1116                      surface(u.ux, u.uy));
1117 #else
1118                 Your("%s\82Í%s\82É\97\8e\82¿\82½\81I", helm_simple_name(otmp),
1119                      surface(u.ux, u.uy));
1120 #endif
1121                 (void) Helmet_off();
1122                 dropx(otmp);
1123             }
1124         }
1125     }
1126     if (nohands(youmonst.data) || verysmall(youmonst.data)) {
1127         if ((otmp = uarmg) != 0) {
1128             if (donning(otmp))
1129                 cancel_don();
1130             /* Drop weapon along with gloves */
1131 /*JP
1132             You("drop your gloves%s!", uwep ? " and weapon" : "");
1133 */
1134             You("\8f¬\8eè%s\82ð\97\8e\82µ\82½\81I", uwep ? "\82â\95\90\8aí" : "");
1135             drop_weapon(0);
1136             (void) Gloves_off();
1137             dropx(otmp);
1138         }
1139         if ((otmp = uarms) != 0) {
1140 /*JP
1141             You("can no longer hold your shield!");
1142 */
1143             You("\82à\82¤\8f\82\82ð\8e\9d\82Á\82Ä\82ç\82ê\82È\82¢\81I");
1144             (void) Shield_off();
1145             dropx(otmp);
1146         }
1147         if ((otmp = uarmh) != 0) {
1148             if (donning(otmp))
1149                 cancel_don();
1150 #if 0 /*JP*/
1151             Your("%s falls to the %s!", helm_simple_name(otmp),
1152                  surface(u.ux, u.uy));
1153 #else
1154             Your("%s\82Í%s\82É\97\8e\82¿\82½\81I", helm_simple_name(otmp),
1155                  surface(u.ux, u.uy));
1156 #endif
1157             (void) Helmet_off();
1158             dropx(otmp);
1159         }
1160     }
1161     if (nohands(youmonst.data) || verysmall(youmonst.data)
1162         || slithy(youmonst.data) || youmonst.data->mlet == S_CENTAUR) {
1163         if ((otmp = uarmf) != 0) {
1164             if (donning(otmp))
1165                 cancel_don();
1166             if (is_whirly(youmonst.data))
1167 /*JP
1168                 Your("boots fall away!");
1169 */
1170                 Your("\8cC\82Í\92E\82°\97\8e\82¿\82½\81I");
1171             else
1172 #if 0 /*JP*/
1173                 Your("boots %s off your feet!",
1174                      verysmall(youmonst.data) ? "slide" : "are pushed");
1175 #else
1176                 Your("\8cC\82Í\82 \82È\82½\82Ì\91«\82©\82ç%s\81I",
1177                      verysmall(youmonst.data) ? "\8a\8a\82è\97\8e\82¿\82½" : "\92E\82°\97\8e\82¿\82½");
1178 #endif
1179             (void) Boots_off();
1180             dropx(otmp);
1181         }
1182     }
1183 }
1184
1185 STATIC_OVL void
1186 drop_weapon(alone)
1187 int alone;
1188 {
1189     struct obj *otmp;
1190 #if 0 /*JP*/
1191     const char *what, *which, *whichtoo;
1192 #else
1193     const char *which, *whichtoo;
1194 #endif
1195     boolean candropwep, candropswapwep;
1196
1197     if (uwep) {
1198         /* !alone check below is currently superfluous but in the
1199          * future it might not be so if there are monsters which cannot
1200          * wear gloves but can wield weapons
1201          */
1202         if (!alone || cantwield(youmonst.data)) {
1203             candropwep = canletgo(uwep, "");
1204             candropswapwep = !u.twoweap || canletgo(uswapwep, "");
1205             if (alone) {
1206 #if 0 /*JP*/
1207                 what = (candropwep && candropswapwep) ? "drop" : "release";
1208 #endif
1209 /*JP
1210                 which = is_sword(uwep) ? "sword" : weapon_descr(uwep);
1211 */
1212                 which = is_sword(uwep) ? "\8c\95" : weapon_descr(uwep);
1213                 if (u.twoweap) {
1214                     whichtoo =
1215 /*JP
1216                         is_sword(uswapwep) ? "sword" : weapon_descr(uswapwep);
1217 */
1218                         is_sword(uswapwep) ? "\8c\95" : weapon_descr(uswapwep);
1219                     if (strcmp(which, whichtoo))
1220 /*JP
1221                         which = "weapon";
1222 */
1223                         which = "\95\90\8aí";
1224                 }
1225 #if 0 /*JP*//*\95¡\90\94\8c`\82É\82µ\82È\82¢*/
1226                 if (uwep->quan != 1L || u.twoweap)
1227                     which = makeplural(which);
1228 #endif
1229
1230 #if 0 /*JP*/
1231                 You("find you must %s %s %s!", what,
1232                     the_your[!!strncmp(which, "corpse", 6)], which);
1233 #else
1234                 You("%s\82ð\97\8e\82Æ\82µ\82½\82±\82Æ\82É\8bC\82Ã\82¢\82½\81I", which);
1235 #endif
1236             }
1237             if (u.twoweap) {
1238                 otmp = uswapwep;
1239                 uswapwepgone();
1240                 if (candropswapwep)
1241                     dropx(otmp);
1242             }
1243             otmp = uwep;
1244             uwepgone();
1245             if (candropwep)
1246                 dropx(otmp);
1247             update_inventory();
1248         } else if (!could_twoweap(youmonst.data)) {
1249             untwoweapon();
1250         }
1251     }
1252 }
1253
1254 void
1255 rehumanize()
1256 {
1257     /* You can't revert back while unchanging */
1258     if (Unchanging && (u.mh < 1)) {
1259 #if 0 /*JP*/
1260         killer.format = NO_KILLER_PREFIX;
1261         Strcpy(killer.name, "killed while stuck in creature form");
1262 #else
1263         killer.format = KILLED_BY;
1264         Strcpy(killer.name, "\8c³\82Ì\8ep\82Ö\96ß\82ê\82¸\82É");
1265 #endif
1266         done(DIED);
1267     }
1268
1269     if (emits_light(youmonst.data))
1270         del_light_source(LS_MONSTER, monst_to_any(&youmonst));
1271 /*JP
1272     polyman("return to %s form!", urace.adj);
1273 */
1274     polyman("%s\82É\96ß\82Á\82½\81I", urace.adj);
1275
1276     if (u.uhp < 1) {
1277         /* can only happen if some bit of code reduces u.uhp
1278            instead of u.mh while poly'd */
1279 /*JP
1280         Your("old form was not healthy enough to survive.");
1281 */
1282         Your("\8c³\82Ì\8ep\82Í\90\82«\82Ä\82¢\82­\82¾\82¯\82Ì\97Í\82ª\82È\82¢\81D");
1283 /*JP
1284         Sprintf(killer.name, "reverting to unhealthy %s form", urace.adj);
1285 */
1286         Sprintf(killer.name, "\95s\8c\92\8dN\82È%s\82Ì\8ep\82É\96ß\82Á\82Ä", urace.adj);
1287         killer.format = KILLED_BY;
1288         done(DIED);
1289     }
1290     nomul(0);
1291
1292     context.botl = 1;
1293     vision_full_recalc = 1;
1294     (void) encumber_msg();
1295
1296     retouch_equipment(2);
1297     if (!uarmg)
1298         selftouch(no_longer_petrify_resistant);
1299 }
1300
1301 int
1302 dobreathe()
1303 {
1304     struct attack *mattk;
1305
1306     if (Strangled) {
1307 /*JP
1308         You_cant("breathe.  Sorry.");
1309 */
1310         You_cant("\91§\82ð\93f\82­\82±\82Æ\82ª\82Å\82«\82È\82¢\81D\8ec\94O\81D");
1311         return 0;
1312     }
1313     if (u.uen < 15) {
1314 /*JP
1315         You("don't have enough energy to breathe!");
1316 */
1317         You("\91§\82ð\93f\82­\82Ì\82É\8f\\95ª\82È\83G\83l\83\8b\83M\81[\82ª\82È\82©\82Á\82½\81D");
1318         return 0;
1319     }
1320     u.uen -= 15;
1321     context.botl = 1;
1322
1323     if (!getdir((char *) 0))
1324         return 0;
1325
1326     mattk = attacktype_fordmg(youmonst.data, AT_BREA, AD_ANY);
1327     if (!mattk)
1328         impossible("bad breath attack?"); /* mouthwash needed... */
1329     else if (!u.dx && !u.dy && !u.dz)
1330         ubreatheu(mattk);
1331     else
1332         buzz((int) (20 + mattk->adtyp - 1), (int) mattk->damn, u.ux, u.uy,
1333              u.dx, u.dy);
1334     return 1;
1335 }
1336
1337 int
1338 dospit()
1339 {
1340     struct obj *otmp;
1341     struct attack *mattk;
1342
1343     if (!getdir((char *) 0))
1344         return 0;
1345     mattk = attacktype_fordmg(youmonst.data, AT_SPIT, AD_ANY);
1346     if (!mattk) {
1347         impossible("bad spit attack?");
1348     } else {
1349         switch (mattk->adtyp) {
1350         case AD_BLND:
1351         case AD_DRST:
1352             otmp = mksobj(BLINDING_VENOM, TRUE, FALSE);
1353             break;
1354         default:
1355             impossible("bad attack type in dospit");
1356         /* fall through */
1357         case AD_ACID:
1358             otmp = mksobj(ACID_VENOM, TRUE, FALSE);
1359             break;
1360         }
1361         otmp->spe = 1; /* to indicate it's yours */
1362         throwit(otmp, 0L, FALSE);
1363     }
1364     return 1;
1365 }
1366
1367 int
1368 doremove()
1369 {
1370     if (!Punished) {
1371         if (u.utrap && u.utraptype == TT_BURIEDBALL) {
1372 #if 0 /*JP*/
1373             pline_The("ball and chain are buried firmly in the %s.",
1374                       surface(u.ux, u.uy));
1375 #else
1376             pline_The("\8b\85\82Æ\8d½\82Í%s\82É\82µ\82Á\82©\82è\82Æ\96\84\82Ü\82Á\82Ä\82¢\82é\81D.",
1377                       surface(u.ux, u.uy));
1378 #endif
1379             return 0;
1380         }
1381 /*JP
1382         You("are not chained to anything!");
1383 */
1384         You("\89½\82à\82Â\82È\82ª\82ê\82Ä\82¢\82È\82¢\81I");
1385         return 0;
1386     }
1387     unpunish();
1388     return 1;
1389 }
1390
1391 int
1392 dospinweb()
1393 {
1394     register struct trap *ttmp = t_at(u.ux, u.uy);
1395
1396     if (Levitation || Is_airlevel(&u.uz) || Underwater
1397         || Is_waterlevel(&u.uz)) {
1398 /*JP
1399         You("must be on the ground to spin a web.");
1400 */
1401         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");
1402         return 0;
1403     }
1404     if (u.uswallow) {
1405 /*JP
1406         You("release web fluid inside %s.", mon_nam(u.ustuck));
1407 */
1408         You("%s\82Ì\93à\82Å\82­\82à\82Ì\91\83\82ð\93f\82«\8fo\82µ\82½\81D", mon_nam(u.ustuck));
1409         if (is_animal(u.ustuck->data)) {
1410             expels(u.ustuck, u.ustuck->data, TRUE);
1411             return 0;
1412         }
1413         if (is_whirly(u.ustuck->data)) {
1414             int i;
1415
1416             for (i = 0; i < NATTK; i++)
1417                 if (u.ustuck->data->mattk[i].aatyp == AT_ENGL)
1418                     break;
1419             if (i == NATTK)
1420                 impossible("Swallower has no engulfing attack?");
1421             else {
1422                 char sweep[30];
1423
1424                 sweep[0] = '\0';
1425                 switch (u.ustuck->data->mattk[i].adtyp) {
1426                 case AD_FIRE:
1427 /*JP
1428                     Strcpy(sweep, "ignites and ");
1429 */
1430                     Strcpy(sweep, "\94­\89Î\82µ");
1431                     break;
1432                 case AD_ELEC:
1433 /*JP
1434                     Strcpy(sweep, "fries and ");
1435 */
1436                     Strcpy(sweep, "\8fÅ\82°");
1437                     break;
1438                 case AD_COLD:
1439 /*JP
1440                     Strcpy(sweep, "freezes, shatters and ");
1441 */
1442                     Strcpy(sweep, "\93\80\82è\82Â\82«\81C\82±\82È\82²\82È\82É\82È\82è");
1443                     break;
1444                 }
1445 /*JP
1446                 pline_The("web %sis swept away!", sweep);
1447 */
1448                 pline("\82­\82à\82Ì\91\83\82Í%s\82È\82­\82È\82Á\82½\81I", sweep);
1449             }
1450             return 0;
1451         } /* default: a nasty jelly-like creature */
1452 /*JP
1453         pline_The("web dissolves into %s.", mon_nam(u.ustuck));
1454 */
1455         pline("\82­\82à\82Ì\91\83\82Í\95ª\89ð\82µ\82Ä%s\82É\82È\82Á\82½\81D", mon_nam(u.ustuck));
1456         return 0;
1457     }
1458     if (u.utrap) {
1459 /*JP
1460         You("cannot spin webs while stuck in a trap.");
1461 */
1462         You("ã©\82É\82Í\82Ü\82Á\82Ä\82¢\82é\8aÔ\82Í\82­\82à\82Ì\91\83\82ð\92£\82ê\82È\82¢\81D");
1463         return 0;
1464     }
1465     exercise(A_DEX, TRUE);
1466     if (ttmp) {
1467         switch (ttmp->ttyp) {
1468         case PIT:
1469         case SPIKED_PIT:
1470 /*JP
1471             You("spin a web, covering up the pit.");
1472 */
1473             You("\82­\82à\82Ì\91\83\82ð\92£\82è\81C\97\8e\82µ\8c\8a\82ð\95¢\82Á\82½\81D");
1474             deltrap(ttmp);
1475             bury_objs(u.ux, u.uy);
1476             newsym(u.ux, u.uy);
1477             return 1;
1478         case SQKY_BOARD:
1479 /*JP
1480             pline_The("squeaky board is muffled.");
1481 */
1482             pline("\82«\82µ\82Þ\94Â\82Í\95¢\82í\82ê\82½\81D");
1483             deltrap(ttmp);
1484             newsym(u.ux, u.uy);
1485             return 1;
1486         case TELEP_TRAP:
1487         case LEVEL_TELEP:
1488         case MAGIC_PORTAL:
1489         case VIBRATING_SQUARE:
1490 /*JP
1491             Your("webbing vanishes!");
1492 */
1493             Your("\82­\82à\82Ì\91\83\82Í\8fÁ\82¦\82½\81I");
1494             return 0;
1495         case WEB:
1496 /*JP
1497             You("make the web thicker.");
1498 */
1499             You("\82­\82à\82Ì\91\83\82ð\82æ\82è\8cú\82­\82µ\82½\81D");
1500             return 1;
1501         case HOLE:
1502         case TRAPDOOR:
1503 #if 0 /*JP*/
1504             You("web over the %s.",
1505                 (ttmp->ttyp == TRAPDOOR) ? "trap door" : "hole");
1506 #else
1507             You("%s\82ð\82­\82à\82Ì\91\83\82Å\95¢\82Á\82½\81D",
1508                 (ttmp->ttyp == TRAPDOOR) ? "\97\8e\82µ\94à" : "\8c\8a");
1509 #endif
1510             deltrap(ttmp);
1511             newsym(u.ux, u.uy);
1512             return 1;
1513         case ROLLING_BOULDER_TRAP:
1514 /*JP
1515             You("spin a web, jamming the trigger.");
1516 */
1517             You("\82­\82à\82Ì\91\83\82ð\92£\82Á\82Ä\81C\83X\83C\83b\83`\82ð\93®\82©\82È\82­\82µ\82½\81D");
1518             deltrap(ttmp);
1519             newsym(u.ux, u.uy);
1520             return 1;
1521         case ARROW_TRAP:
1522         case DART_TRAP:
1523         case BEAR_TRAP:
1524         case ROCKTRAP:
1525         case FIRE_TRAP:
1526         case LANDMINE:
1527         case SLP_GAS_TRAP:
1528         case RUST_TRAP:
1529         case MAGIC_TRAP:
1530         case ANTI_MAGIC:
1531         case POLY_TRAP:
1532 /*JP
1533             You("have triggered a trap!");
1534 */
1535             You("ã©\82ð\8en\93®\82³\82¹\82Ä\82µ\82Ü\82Á\82½\81I");
1536             dotrap(ttmp, 0);
1537             return 1;
1538         default:
1539             impossible("Webbing over trap type %d?", ttmp->ttyp);
1540             return 0;
1541         }
1542     } else if (On_stairs(u.ux, u.uy)) {
1543         /* cop out: don't let them hide the stairs */
1544 #if 0 /*JP:T*/
1545         Your("web fails to impede access to the %s.",
1546              (levl[u.ux][u.uy].typ == STAIRS) ? "stairs" : "ladder");
1547 #else
1548         Your("\82­\82à\82Ì\91\83\82Í%s\82Ö\82Ì\88Ú\93®\82ð\8e×\96\82\82Å\82«\82È\82¢\81D",
1549              (levl[u.ux][u.uy].typ == STAIRS) ? "\8aK\92i" : "\82Í\82µ\82²");
1550 #endif
1551         return 1;
1552     }
1553     ttmp = maketrap(u.ux, u.uy, WEB);
1554     if (ttmp) {
1555         ttmp->madeby_u = 1;
1556         feeltrap(ttmp);
1557     }
1558     return 1;
1559 }
1560
1561 int
1562 dosummon()
1563 {
1564     int placeholder;
1565     if (u.uen < 10) {
1566 /*JP
1567         You("lack the energy to send forth a call for help!");
1568 */
1569         You("\8f\95\82¯\82ð\8cÄ\82Ô\82¾\82¯\82Ì\91Ì\97Í\82ª\82È\82¢\81I");
1570         return 0;
1571     }
1572     u.uen -= 10;
1573     context.botl = 1;
1574
1575 /*JP
1576     You("call upon your brethren for help!");
1577 */
1578     You("\92\87\8aÔ\82ð\8cÄ\82ñ\82¾\81I");
1579     exercise(A_WIS, TRUE);
1580     if (!were_summon(youmonst.data, TRUE, &placeholder, (char *) 0))
1581 /*JP
1582         pline("But none arrive.");
1583 */
1584         pline("\82µ\82©\82µ\81C\89½\82à\97\88\82È\82¢\81D");
1585     return 1;
1586 }
1587
1588 int
1589 dogaze()
1590 {
1591     register struct monst *mtmp;
1592     int looked = 0;
1593     char qbuf[QBUFSZ];
1594     int i;
1595     uchar adtyp = 0;
1596
1597     for (i = 0; i < NATTK; i++) {
1598         if (youmonst.data->mattk[i].aatyp == AT_GAZE) {
1599             adtyp = youmonst.data->mattk[i].adtyp;
1600             break;
1601         }
1602     }
1603     if (adtyp != AD_CONF && adtyp != AD_FIRE) {
1604         impossible("gaze attack %d?", adtyp);
1605         return 0;
1606     }
1607
1608     if (Blind) {
1609 /*JP
1610         You_cant("see anything to gaze at.");
1611 */
1612         You("\96Ú\82ª\8c©\82¦\82È\82¢\82Ì\82Å\81C\82É\82ç\82ß\82È\82¢\81D");
1613         return 0;
1614     } else if (Hallucination) {
1615 /*JP
1616         You_cant("gaze at anything you can see.");
1617 */
1618         You_cant("\8c©\82¦\82é\82à\82Ì\82ð\89½\82à\82É\82ç\82ß\82È\82¢\81D");
1619         return 0;
1620     }
1621     if (u.uen < 15) {
1622 /*JP
1623         You("lack the energy to use your special gaze!");
1624 */
1625         You("\82É\82ç\82Þ\82¾\82¯\82Ì\91Ì\97Í\82ª\82È\82¢\81I");
1626         return 0;
1627     }
1628     u.uen -= 15;
1629     context.botl = 1;
1630
1631     for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
1632         if (DEADMONSTER(mtmp))
1633             continue;
1634         if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my)) {
1635             looked++;
1636             if (Invis && !perceives(mtmp->data)) {
1637 /*JP
1638                 pline("%s seems not to notice your gaze.", Monnam(mtmp));
1639 */
1640                 pline("%s\82Í\82 \82È\82½\82Ì\82É\82ç\82Ý\82É\8bC\82ª\82Â\82¢\82Ä\82È\82¢\82æ\82¤\82¾\81D", Monnam(mtmp));
1641             } else if (mtmp->minvis && !See_invisible) {
1642 /*JP
1643                 You_cant("see where to gaze at %s.", Monnam(mtmp));
1644 */
1645                 You("%s\82Í\8c©\82¦\82È\82¢\82Ì\82Å\81C\82É\82ç\82ß\82È\82¢", Monnam(mtmp));
1646             } else if (mtmp->m_ap_type == M_AP_FURNITURE
1647                        || mtmp->m_ap_type == M_AP_OBJECT) {
1648                 looked--;
1649                 continue;
1650             } else if (flags.safe_dog && mtmp->mtame && !Confusion) {
1651 /*JP
1652                 You("avoid gazing at %s.", y_monnam(mtmp));
1653 */
1654                 You("%s\82©\82ç\96Ú\82ð\82»\82ç\82µ\82Ä\82µ\82Ü\82Á\82½\81D", y_monnam(mtmp));
1655             } else {
1656                 if (flags.confirm && mtmp->mpeaceful && !Confusion) {
1657 #if 0 /*JP*/
1658                     Sprintf(qbuf, "Really %s %s?",
1659                             (adtyp == AD_CONF) ? "confuse" : "attack",
1660                             mon_nam(mtmp));
1661 #else
1662                     Sprintf(qbuf, "\96{\93\96\82É%s\82ð%s\81H",
1663                             mon_nam(mtmp),
1664                             (adtyp == AD_CONF) ? "\8d¬\97\90\82³\82¹\82é" : "\8dU\8c\82\82·\82é");
1665 #endif
1666                     if (yn(qbuf) != 'y')
1667                         continue;
1668                     setmangry(mtmp);
1669                 }
1670                 if (!mtmp->mcanmove || mtmp->mstun || mtmp->msleeping
1671                     || !mtmp->mcansee || !haseyes(mtmp->data)) {
1672                     looked--;
1673                     continue;
1674                 }
1675                 /* No reflection check for consistency with when a monster
1676                  * gazes at *you*--only medusa gaze gets reflected then.
1677                  */
1678                 if (adtyp == AD_CONF) {
1679                     if (!mtmp->mconf)
1680 /*JP
1681                         Your("gaze confuses %s!", mon_nam(mtmp));
1682 */
1683                         Your("\82É\82ç\82Ý\82Í%s\82ð\8d¬\97\90\82³\82¹\82½\81I", mon_nam(mtmp));
1684                     else
1685 /*JP
1686                         pline("%s is getting more and more confused.",
1687 */
1688                         pline("%s\82Í\82Ü\82·\82Ü\82·\8d¬\97\90\82µ\82½\81I",
1689                               Monnam(mtmp));
1690                     mtmp->mconf = 1;
1691                 } else if (adtyp == AD_FIRE) {
1692                     int dmg = d(2, 6), lev = (int) u.ulevel;
1693
1694 /*JP
1695                     You("attack %s with a fiery gaze!", mon_nam(mtmp));
1696 */
1697                     You("\89\8a\82Ì\82É\82ç\82Ý\82Å%s\82ð\8dU\8c\82\82µ\82½\81I", mon_nam(mtmp));
1698                     if (resists_fire(mtmp)) {
1699 /*JP
1700                         pline_The("fire doesn't burn %s!", mon_nam(mtmp));
1701 */
1702                         pline("%s\82Í\89\8a\82Å\94R\82¦\82È\82©\82Á\82½\81I", mon_nam(mtmp));
1703                         dmg = 0;
1704                     }
1705                     if (lev > rn2(20))
1706                         (void) destroy_mitem(mtmp, SCROLL_CLASS, AD_FIRE);
1707                     if (lev > rn2(20))
1708                         (void) destroy_mitem(mtmp, POTION_CLASS, AD_FIRE);
1709                     if (lev > rn2(25))
1710                         (void) destroy_mitem(mtmp, SPBOOK_CLASS, AD_FIRE);
1711                     if (dmg)
1712                         mtmp->mhp -= dmg;
1713                     if (mtmp->mhp <= 0)
1714                         killed(mtmp);
1715                 }
1716                 /* For consistency with passive() in uhitm.c, this only
1717                  * affects you if the monster is still alive.
1718                  */
1719                 if (DEADMONSTER(mtmp))
1720                     continue;
1721
1722                 if (mtmp->data == &mons[PM_FLOATING_EYE] && !mtmp->mcan) {
1723                     if (!Free_action) {
1724 /*JP
1725                         You("are frozen by %s gaze!",
1726 */
1727                         You("%s\82Ì\82É\82ç\82Ý\82Å\93®\82¯\82È\82­\82È\82Á\82½\81I", 
1728                             s_suffix(mon_nam(mtmp)));
1729                         nomul((u.ulevel > 6 || rn2(4))
1730                                   ? -d((int) mtmp->m_lev + 1,
1731                                        (int) mtmp->data->mattk[0].damd)
1732                                   : -200);
1733 /*JP
1734                         multi_reason = "frozen by a monster's gaze";
1735 */
1736                         multi_reason = "\89ö\95¨\82Ì\82É\82ç\82Ý\82Å\8dd\92¼\82µ\82Ä\82¢\82é\8e\9e\82É";
1737                         nomovemsg = 0;
1738                         return 1;
1739                     } else
1740 /*JP
1741                         You("stiffen momentarily under %s gaze.",
1742 */
1743                         You("%s\82Ì\82É\82ç\82Ý\82Å\88ê\8fu\8dd\92¼\82µ\82½\81D",
1744                             s_suffix(mon_nam(mtmp)));
1745                 }
1746                 /* Technically this one shouldn't affect you at all because
1747                  * the Medusa gaze is an active monster attack that only
1748                  * works on the monster's turn, but for it to *not* have an
1749                  * effect would be too weird.
1750                  */
1751                 if (mtmp->data == &mons[PM_MEDUSA] && !mtmp->mcan) {
1752 /*JP
1753                     pline("Gazing at the awake %s is not a very good idea.",
1754 */
1755                     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",
1756                           l_monnam(mtmp));
1757                     /* as if gazing at a sleeping anything is fruitful... */
1758 /*JP
1759                     You("turn to stone...");
1760 */
1761                     You("\90Î\82É\82È\82Á\82½\81D\81D\81D");
1762                     killer.format = KILLED_BY;
1763 /*JP
1764                     Strcpy(killer.name, "deliberately meeting Medusa's gaze");
1765 */
1766                     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Ä");
1767                     done(STONING);
1768                 }
1769             }
1770         }
1771     }
1772     if (!looked)
1773 /*JP
1774         You("gaze at no place in particular.");
1775 */
1776         You("\8eÀ\8dÛ\82É\82Í\89½\82à\82É\82ç\82ß\82È\82©\82Á\82½\81D");
1777     return 1;
1778 }
1779
1780 int
1781 dohide()
1782 {
1783     boolean ismimic = youmonst.data->mlet == S_MIMIC,
1784             on_ceiling = is_clinger(youmonst.data) || Flying;
1785
1786     /* can't hide while being held (or holding) or while trapped
1787        (except for floor hiders [trapper or mimic] in pits) */
1788     if (u.ustuck || (u.utrap && (u.utraptype != TT_PIT || on_ceiling))) {
1789 #if 0 /*JP*/
1790         You_cant("hide while you're %s.",
1791                  !u.ustuck ? "trapped" : !sticks(youmonst.data)
1792                                              ? "being held"
1793                                              : humanoid(u.ustuck->data)
1794                                                    ? "holding someone"
1795                                                    : "holding that creature");
1796 #else
1797         You_cant("%s\8aÔ\82Í\89B\82ê\82ç\82ê\82È\82¢\81D",
1798                  !u.ustuck ? "\95ß\82Ü\82Á\82Ä\82¢\82é" : !sticks(youmonst.data)
1799                                              ? "\95ß\82Ü\82¦\82ç\82ê\82Ä\82¢\82é"
1800                                              : humanoid(u.ustuck->data)
1801                                                    ? "\92N\82©\82ð\82Â\82©\82ñ\82Å\82¢\82é"
1802                                                    : "\89ö\95¨\82ð\82Â\82©\82ñ\82Å\82¢\82é");
1803 #endif
1804         if (u.uundetected
1805             || (ismimic && youmonst.m_ap_type != M_AP_NOTHING)) {
1806             u.uundetected = 0;
1807             youmonst.m_ap_type = M_AP_NOTHING;
1808             newsym(u.ux, u.uy);
1809         }
1810         return 0;
1811     }
1812     /* note: the eel and hides_under cases are hypothetical;
1813        such critters aren't offered the option of hiding via #monster */
1814     if (youmonst.data->mlet == S_EEL && !is_pool(u.ux, u.uy)) {
1815         if (IS_FOUNTAIN(levl[u.ux][u.uy].typ))
1816 /*JP
1817             The("fountain is not deep enough to hide in.");
1818 */
1819             The("\90ò\82Í\89B\82ê\82ç\82ê\82é\82Ù\82Ç\90[\82­\82È\82¢\81D");
1820         else
1821 /*JP
1822             There("is no water to hide in here.");
1823 */
1824             There("\82±\82±\82É\82Í\89B\82ê\82é\82½\82ß\82Ì\90\85\82ª\82È\82¢\81D");
1825         u.uundetected = 0;
1826         return 0;
1827     }
1828     if (hides_under(youmonst.data) && !level.objects[u.ux][u.uy]) {
1829 /*JP
1830         There("is nothing to hide under here.");
1831 */
1832         There("\82±\82±\82É\82Í\89B\82ê\82ç\82ê\82é\82à\82Ì\82ª\82È\82¢\81D");
1833         u.uundetected = 0;
1834         return 0;
1835     }
1836     /* Planes of Air and Water */
1837     if (on_ceiling && !has_ceiling(&u.uz)) {
1838 /*JP
1839         There("is nowhere to hide above you.");
1840 */
1841         There("\82 \82È\82½\82Ì\8fã\82É\82Í\89B\82ê\82ç\82ê\82é\8fê\8f\8a\82ª\82È\82¢\81D");
1842         u.uundetected = 0;
1843         return 0;
1844     }
1845     if ((is_hider(youmonst.data) && !Flying) /* floor hider */
1846         && (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))) {
1847 /*JP
1848         There("is nowhere to hide beneath you.");
1849 */
1850         There("\82 \82È\82½\82Ì\89º\82É\82Í\89B\82ê\82ç\82ê\82é\8fê\8f\8a\82ª\82È\82¢\81D");
1851         u.uundetected = 0;
1852         return 0;
1853     }
1854     /* TODO? inhibit floor hiding at furniture locations, or
1855      * else make youhiding() give smarter messages at such spots.
1856      */
1857
1858     if (u.uundetected || (ismimic && youmonst.m_ap_type != M_AP_NOTHING)) {
1859         youhiding(FALSE, 1); /* "you are already hiding" */
1860         return 0;
1861     }
1862
1863     if (ismimic) {
1864         /* should bring up a dialog "what would you like to imitate?" */
1865         youmonst.m_ap_type = M_AP_OBJECT;
1866         youmonst.mappearance = STRANGE_OBJECT;
1867     } else
1868         u.uundetected = 1;
1869     newsym(u.ux, u.uy);
1870     youhiding(FALSE, 0); /* "you are now hiding" */
1871     return 1;
1872 }
1873
1874 int
1875 dopoly()
1876 {
1877     struct permonst *savedat = youmonst.data;
1878
1879     if (is_vampire(youmonst.data)) {
1880         polyself(2);
1881         if (savedat != youmonst.data) {
1882 /*JP
1883             You("transform into %s.", an(youmonst.data->mname));
1884 */
1885             You("%s\82Ì\8ep\82É\82È\82Á\82½\81D", youmonst.data->mname);
1886             newsym(u.ux, u.uy);
1887         }
1888     }
1889     return 1;
1890 }
1891
1892 int
1893 domindblast()
1894 {
1895     struct monst *mtmp, *nmon;
1896
1897     if (u.uen < 10) {
1898 /*JP
1899         You("concentrate but lack the energy to maintain doing so.");
1900 */
1901         You("\8fW\92\86\82µ\82½\81D\82µ\82©\82µ\83G\83l\83\8b\83M\81[\82ª\91«\82è\82È\82¢\81D");
1902         return 0;
1903     }
1904     u.uen -= 10;
1905     context.botl = 1;
1906
1907 /*JP
1908     You("concentrate.");
1909 */
1910     You("\8fW\92\86\82µ\82½\81D");
1911 /*JP
1912     pline("A wave of psychic energy pours out.");
1913 */
1914     pline("\90¸\90_\83G\83l\83\8b\83M\81[\94g\82ª\95ú\8eU\82µ\82½\81D");
1915     for (mtmp = fmon; mtmp; mtmp = nmon) {
1916         int u_sen;
1917
1918         nmon = mtmp->nmon;
1919         if (DEADMONSTER(mtmp))
1920             continue;
1921         if (distu(mtmp->mx, mtmp->my) > BOLT_LIM * BOLT_LIM)
1922             continue;
1923         if (mtmp->mpeaceful)
1924             continue;
1925         u_sen = telepathic(mtmp->data) && !mtmp->mcansee;
1926         if (u_sen || (telepathic(mtmp->data) && rn2(2)) || !rn2(10)) {
1927 #if 0 /*JP*/
1928             You("lock in on %s %s.", s_suffix(mon_nam(mtmp)),
1929                 u_sen ? "telepathy"
1930                       : telepathic(mtmp->data) ? "latent telepathy" : "mind");
1931 #else
1932             pline("%s\82Ì%s\82è\8d\9e\82ñ\82¾\81D", mon_nam(mtmp),
1933                 u_sen ? "\90¸\90_\82É\93ü"
1934                       : telepathic(mtmp->data) ? "\90ö\8dÝ\93I\90¸\90_\82É\93ü" : "\90[\91w\88Ó\8e¯\82É\90ö");
1935 #endif
1936             mtmp->mhp -= rnd(15);
1937             if (mtmp->mhp <= 0)
1938                 killed(mtmp);
1939         }
1940     }
1941     return 1;
1942 }
1943
1944 STATIC_OVL void
1945 uunstick()
1946 {
1947 /*JP
1948     pline("%s is no longer in your clutches.", Monnam(u.ustuck));
1949 */
1950     pline("%s\82Í\82 \82È\82½\82Ì\8eè\82©\82ç\93¦\82ê\82½\81D", Monnam(u.ustuck));
1951     u.ustuck = 0;
1952 }
1953
1954 void
1955 skinback(silently)
1956 boolean silently;
1957 {
1958     if (uskin) {
1959         if (!silently)
1960 /*JP
1961             Your("skin returns to its original form.");
1962 */
1963             Your("\94ç\95\86\82Í\96{\97\88\82Ì\8ep\82É\96ß\82Á\82½\81D");
1964         uarm = uskin;
1965         uskin = (struct obj *) 0;
1966         /* undo save/restore hack */
1967         uarm->owornmask &= ~I_SPECIAL;
1968     }
1969 }
1970
1971 const char *
1972 mbodypart(mon, part)
1973 struct monst *mon;
1974 int part;
1975 {
1976     static NEARDATA const char
1977 #if 0 /*JP*/
1978         *humanoid_parts[] = { "arm",       "eye",  "face",         "finger",
1979                               "fingertip", "foot", "hand",         "handed",
1980                               "head",      "leg",  "light headed", "neck",
1981                               "spine",     "toe",  "hair",         "blood",
1982                               "lung",      "nose", "stomach" },
1983 #else
1984         *humanoid_parts[] = { "\98r", "\96Ú", "\8aç", "\8ew",
1985             "\8ew\90æ", "\91«", "\8eè", "\8eè\82É\82·\82é",
1986             "\93ª", "\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
1987             "\94w\8d\9c", "\92Ü\90æ", "\94¯",  "\8c\8c",
1988             "\94x", "\95@", "\88Ý"},
1989 #endif
1990 #if 0 /*JP*/
1991         *jelly_parts[] = { "pseudopod", "dark spot", "front",
1992                            "pseudopod extension", "pseudopod extremity",
1993                            "pseudopod root", "grasp", "grasped",
1994                            "cerebral area", "lower pseudopod", "viscous",
1995                            "middle", "surface", "pseudopod extremity",
1996                            "ripples", "juices", "surface", "sensor",
1997                            "stomach" },
1998 #else
1999     *jelly_parts[] = { "\8b[\8e\97\90G\8eè", "\8d\95\82¢\94Á\93_", "\91O\96Ê",
2000         "\8b[\8e\97\90G\8eè\82Ì\90æ", "\8b[\8e\97\90G\8eè",
2001         "\8b[\8e\97\90G\8eè\82Ì\8a²", "\90G\8eè", "\88¬\82é",
2002         "\94]\82Ì\97Ì\88æ", "\89º\95û\82Ì\8b[\8e\97\90G\8eè", "\82Ë\82Î\82Ë\82Î\82µ\82Ä\82«\82½",
2003         "\92\86\8aÔ\97Ì\88æ", "\95\\96Ê",  "\8b[\8e\97\90G\8eè",
2004         "\94g\96ä", "\91Ì\89t", "\95\\96Ê", "\8a´\8ao\8aí",
2005         "\88Ý"},
2006 #endif
2007 #if 0 /*JP*/
2008         *animal_parts[] = { "forelimb",  "eye",           "face",
2009                             "foreclaw",  "claw tip",      "rear claw",
2010                             "foreclaw",  "clawed",        "head",
2011                             "rear limb", "light headed",  "neck",
2012                             "spine",     "rear claw tip", "fur",
2013                             "blood",     "lung",          "nose",
2014                             "stomach" },
2015 #else
2016     *animal_parts[] = { "\91O\91«", "\96Ú", "\8aç",
2017         "\91O\92Ü", "\92Ü\90æ", "\8cã\92Ü",
2018         "\91O\92Ü", "\82Ð\82Á\82©\82¯\82é", "\93ª",
2019         "\8cã\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
2020         "\94w\8d\9c", "\8cã\92Ü\90æ", "\96Ñ\94ç",
2021         "\8c\8c", "\94x", "\95@",
2022         "\88Ý"},
2023 #endif
2024 #if 0 /*JP*/
2025         *bird_parts[] = { "wing",     "eye",  "face",         "wing",
2026                           "wing tip", "foot", "wing",         "winged",
2027                           "head",     "leg",  "light headed", "neck",
2028                           "spine",    "toe",  "feathers",     "blood",
2029                           "lung",     "bill", "stomach" },
2030 #else
2031     *bird_parts[] = { "\97\83", "\96Ú", "\8aç", "\97\83",
2032         "\97\83\82Ì\90æ", "\91«", "\97\83", "\97\83\82É\82Æ\82é",
2033         "\93ª", "\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
2034         "\94w\8d\9c", "\92Ü\90æ", "\89H\96Ñ", "\8c\8c",
2035         "\94x", "\82­\82¿\82Î\82µ", "\88Ý" },
2036 #endif
2037 #if 0 /*JP*/
2038         *horse_parts[] = { "foreleg",  "eye",           "face",
2039                            "forehoof", "hoof tip",      "rear hoof",
2040                            "forehoof", "hooved",        "head",
2041                            "rear leg", "light headed",  "neck",
2042                            "backbone", "rear hoof tip", "mane",
2043                            "blood",    "lung",          "nose",
2044                            "stomach" },
2045 #else
2046     *horse_parts[] = { "\91O\91«", "\96Ú", "\8aç",
2047         "\91O\92û", "\92û", "\8cã\92û",
2048         "\91O\92Ü", "\92û\82É\82Í\82³\82Þ", "\93ª",
2049         "\8cã\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
2050         "\94w\8d\9c", "\8cã\92Ü\90æ", "\82½\82Ä\82ª\82Ý",
2051         "\8c\8c", "\94x", "\95@",
2052         "\88Ý" },
2053 #endif
2054 #if 0 /*JP*/
2055         *sphere_parts[] = { "appendage", "optic nerve", "body", "tentacle",
2056                             "tentacle tip", "lower appendage", "tentacle",
2057                             "tentacled", "body", "lower tentacle",
2058                             "rotational", "equator", "body",
2059                             "lower tentacle tip", "cilia", "life force",
2060                             "retina", "olfactory nerve", "interior" },
2061 #else
2062         *sphere_parts[] = { "\93Ë\8bN", "\8e\8b\8ao\90_\8co", "\91Ì", "\90G\8eè",
2063             "\90G\8eè\82Ì\90æ", "\89º\82Ì\93Ë\8bN", "\90G\8eè",
2064             "\90G\8eè\82É\8e\9d\82Â", "\91Ì", "\89º\82Ì\90G\8eè",
2065             "\89ñ\93]\82µ\82½", "\92\86\90S\90ü", "\91Ì",
2066             "\89º\82Ì\90G\8eè\82Ì\90æ", "\91@\96Ñ", "\90\96½\97Í",
2067             "\96Ô\96\8c", "\9ak\8ao\92\86\90\95", "\93à\95\94" },
2068 #endif
2069 #if 0 /*JP*/
2070         *fungus_parts[] = { "mycelium", "visual area", "front",
2071                             "hypha",    "hypha",       "root",
2072                             "strand",   "stranded",    "cap area",
2073                             "rhizome",  "sporulated",  "stalk",
2074                             "root",     "rhizome tip", "spores",
2075                             "juices",   "gill",        "gill",
2076                             "interior" },
2077 #else
2078         *fungus_parts[] = { "\8bÛ\8e\85\91Ì", "\8e\8b\8ao\97Ì\88æ", "\91O",
2079             "\8bÛ\8e\85", "\8bÛ\8e\85", "\8dª",
2080             "\90G\8eè", "\90G\8eè\82É\82©\82ç\82Ý\82Â\82¯\82é", "\8eP",
2081             "\8dª\8cs", "\8d¬\97\90\82·\82é", "\8e²",
2082             "\8dª", "\8dª\8cs\82Ì\90æ", "\89è\96E",
2083             "\91Ì\89t", "\82¦\82ç", "\82¦\82ç",
2084             "\93à\95\94"},
2085 #endif
2086 #if 0 /*JP*/
2087         *vortex_parts[] = { "region",        "eye",           "front",
2088                             "minor current", "minor current", "lower current",
2089                             "swirl",         "swirled",       "central core",
2090                             "lower current", "addled",        "center",
2091                             "currents",      "edge",          "currents",
2092                             "life force",    "center",        "leading edge",
2093                             "interior" },
2094 #else
2095         *vortex_parts[] = { "\97Ì\88æ", "\96Ú", "\91O",
2096             "\8f¬\82³\82¢\97¬\82ê", "\8f¬\82³\82¢\97¬\82ê", "\89º\95\94\82Ì\97¬\82ê",
2097             "\89Q\8aª", "\89Q\82É\8aª\82­", "\89Q\82Ì\92\86\90S",
2098             "\89º\95\94\82Ì\97¬\82ê", "\8d¬\97\90\82µ\82½", "\92\86\90S\95\94",
2099             "\97¬\82ê", "\8aO\8eü", "\8bC\97¬",
2100             "\90\96½\97Í", "\92\86\90S", "\91O\89\8f",
2101             "\93à\95\94" },
2102 #endif
2103 #if 0 /*JP*/
2104         *snake_parts[] = { "vestigial limb", "eye", "face", "large scale",
2105                            "large scale tip", "rear region", "scale gap",
2106                            "scale gapped", "head", "rear region",
2107                            "light headed", "neck", "length", "rear scale",
2108                            "scales", "blood", "lung", "forked tongue",
2109                            "stomach" },
2110 #else
2111         *snake_parts[] = { "\91Þ\89»\82µ\82½\91«", "\96Ú", "\8aç", "\91å\82«\82È\97Ø",
2112             "\91å\82«\82È\97Ø\82Ì\90æ", "\8cã\95\94\95ª", "\97Ø\82Ì\8c\84\8aÔ",
2113             "\97Ø\82Ì\8c\84\8aÔ\82É\82Â\82¯\82é", "\93ª", "\8cã\95\94\95ª",
2114             "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ", "\91Ì", "\8cã\95\94\95ª\82Ì\8aZ",
2115             "\97Ø", "\8c\8c", "\94x", "\90ã",
2116             "\88Ý" },
2117 #endif
2118 #if 0 /*JP*/
2119         *worm_parts[] = { "anterior segment", "light sensitive cell",
2120                           "clitellum", "setae", "setae", "posterior segment",
2121                           "segment", "segmented", "anterior segment",
2122                           "posterior", "over stretched", "clitellum",
2123                           "length", "posterior setae", "setae", "blood",
2124                           "skin", "prostomium", "stomach" },
2125 #else
2126         *worm_parts[] = { "\91O\8bæ", "\8a´\8cõ\90«\8d×\96E",
2127                           "\8aÂ\91Ñ", "\8ap", "\8ap", "\8cã\8bæ",
2128                           "\90ß", "\90ß\82É\82Â\82¯\82é", "\91O\8bæ",
2129                           "\8cã\95\94", "\90L\82Ñ\82·\82¬\82½", "\8aÂ\91Ñ",
2130                           "\91Ì", "\8cã\95\94\82Ì\8ap", "\8ap", "\8c\8c",
2131                           "\94ç\95\86", "\8cû\91O\97t", "\88Ý" },
2132 #endif
2133 #if 0 /*JP*/
2134         *fish_parts[] = { "fin", "eye", "premaxillary", "pelvic axillary",
2135                           "pelvic fin", "anal fin", "pectoral fin", "finned",
2136                           "head", "peduncle", "played out", "gills",
2137                           "dorsal fin", "caudal fin", "scales", "blood",
2138                           "gill", "nostril", "stomach" };
2139 #else
2140         *fish_parts[] = { "\82Ð\82ê", "\96Ú", "\8aç", "\82Ð\82ê\82Ì\90æ",
2141             "\82Ð\82ê\82Ì\90æ", "\94ö\82Ñ\82ê", "\8b¹\82Ð\82ê", "\82Ð\82ê\82Å\8e\9d\82Â",
2142             "\93ª", "\94ö\95¿", "\82ß\82Ü\82¢\82ª\82µ\82½", "\82¦\82ç",
2143             "\94w\82Ñ\82ê", "\94ö\82Ñ\82ê", "\97Ø", "\8c\8c",
2144             "\82¦\82ç", "\95@", "\88Ý" };
2145 #endif
2146 #if 0 /*JP*//*\8eg\82í\82È\82¢*/
2147     /* claw attacks are overloaded in mons[]; most humanoids with
2148        such attacks should still reference hands rather than claws */
2149     static const char not_claws[] = {
2150         S_HUMAN,     S_MUMMY,   S_ZOMBIE, S_ANGEL, S_NYMPH, S_LEPRECHAUN,
2151         S_QUANTMECH, S_VAMPIRE, S_ORC,    S_GIANT, /* quest nemeses */
2152         '\0' /* string terminator; assert( S_xxx != 0 ); */
2153     };
2154 #endif
2155     struct permonst *mptr = mon->data;
2156
2157 #if 0 /*JP*/
2158 /* paw\82Í\8c¢\82Æ\82©\94L\82Ì\8eè\81Cclaw\82Í\83^\83J\82Ì\91«\82Ì\82æ\82¤\82È\82©\82¬\82Â\82ß\81C
2159    \82Ç\82¿\82ç\82à\93ú\96{\8cê\82\82á\81u\8eè\81v\82Å\82¢\82¢\82Å\82µ\82å\82¤\81D
2160 */
2161     /* some special cases */
2162     if (mptr->mlet == S_DOG || mptr->mlet == S_FELINE
2163         || mptr->mlet == S_RODENT || mptr == &mons[PM_OWLBEAR]) {
2164         switch (part) {
2165         case HAND:
2166             return "paw";
2167         case HANDED:
2168             return "pawed";
2169         case FOOT:
2170             return "rear paw";
2171         case ARM:
2172         case LEG:
2173             return horse_parts[part]; /* "foreleg", "rear leg" */
2174         default:
2175             break; /* for other parts, use animal_parts[] below */
2176         }
2177     } else if (mptr->mlet == S_YETI) { /* excl. owlbear due to 'if' above */
2178         /* opposable thumbs, hence "hands", "arms", "legs", &c */
2179         return humanoid_parts[part]; /* yeti/sasquatch, monkey/ape */
2180     }
2181     if ((part == HAND || part == HANDED)
2182         && (humanoid(mptr) && attacktype(mptr, AT_CLAW)
2183             && !index(not_claws, mptr->mlet) && mptr != &mons[PM_STONE_GOLEM]
2184             && mptr != &mons[PM_INCUBUS] && mptr != &mons[PM_SUCCUBUS]))
2185         return (part == HAND) ? "claw" : "clawed";
2186 #endif
2187 #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*/
2188     if ((mptr == &mons[PM_MUMAK] || mptr == &mons[PM_MASTODON])
2189         && part == NOSE)
2190         return "trunk";
2191 #endif
2192     if (mptr == &mons[PM_SHARK] && part == HAIR)
2193 #if 0 /*JP*/
2194         return "skin"; /* sharks don't have scales */
2195 #else
2196         return "\93ª"; /* sharks don't have scales */
2197 #endif
2198     if ((mptr == &mons[PM_JELLYFISH] || mptr == &mons[PM_KRAKEN])
2199         && (part == ARM || part == FINGER || part == HAND || part == FOOT
2200             || part == TOE))
2201 /*JP
2202         return "tentacle";
2203 */
2204         return "\90G\8eè";
2205     if (mptr == &mons[PM_FLOATING_EYE] && part == EYE)
2206 /*JP
2207         return "cornea";
2208 */
2209         return "\8ap\96\8c";
2210     if (humanoid(mptr) && (part == ARM || part == FINGER || part == FINGERTIP
2211                            || part == HAND || part == HANDED))
2212         return humanoid_parts[part];
2213     if (mptr == &mons[PM_RAVEN])
2214         return bird_parts[part];
2215     if (mptr->mlet == S_CENTAUR || mptr->mlet == S_UNICORN
2216         || (mptr == &mons[PM_ROTHE] && part != HAIR))
2217         return horse_parts[part];
2218     if (mptr->mlet == S_LIGHT) {
2219 #if 0 /*JP*/
2220         if (part == HANDED)
2221             return "rayed";
2222         else if (part == ARM || part == FINGER || part == FINGERTIP
2223                  || part == HAND)
2224             return "ray";
2225         else
2226             return "beam";
2227 #else
2228         if (part == HANDED || part == ARM || part == FINGER
2229             || part == FINGERTIP || part == HAND) {
2230             return "\8cõ";
2231         }
2232 #endif
2233     }
2234     if (mptr == &mons[PM_STALKER] && part == HEAD)
2235 /*JP
2236         return "head";
2237 */
2238         return "\93ª";
2239     if (mptr->mlet == S_EEL && mptr != &mons[PM_JELLYFISH])
2240         return fish_parts[part];
2241     if (mptr->mlet == S_WORM)
2242         return worm_parts[part];
2243     if (slithy(mptr) || (mptr->mlet == S_DRAGON && part == HAIR))
2244         return snake_parts[part];
2245     if (mptr->mlet == S_EYE)
2246         return sphere_parts[part];
2247     if (mptr->mlet == S_JELLY || mptr->mlet == S_PUDDING
2248         || mptr->mlet == S_BLOB || mptr == &mons[PM_JELLYFISH])
2249         return jelly_parts[part];
2250     if (mptr->mlet == S_VORTEX || mptr->mlet == S_ELEMENTAL)
2251         return vortex_parts[part];
2252     if (mptr->mlet == S_FUNGUS)
2253         return fungus_parts[part];
2254     if (humanoid(mptr))
2255         return humanoid_parts[part];
2256     return animal_parts[part];
2257 }
2258
2259 const char *
2260 body_part(part)
2261 int part;
2262 {
2263     return mbodypart(&youmonst, part);
2264 }
2265
2266 int
2267 poly_gender()
2268 {
2269     /* Returns gender of polymorphed player;
2270      * 0/1=same meaning as flags.female, 2=none.
2271      */
2272     if (is_neuter(youmonst.data) || !humanoid(youmonst.data))
2273         return 2;
2274     return flags.female;
2275 }
2276
2277 void
2278 ugolemeffects(damtype, dam)
2279 int damtype, dam;
2280 {
2281     int heal = 0;
2282
2283     /* We won't bother with "slow"/"haste" since players do not
2284      * have a monster-specific slow/haste so there is no way to
2285      * restore the old velocity once they are back to human.
2286      */
2287     if (u.umonnum != PM_FLESH_GOLEM && u.umonnum != PM_IRON_GOLEM)
2288         return;
2289     switch (damtype) {
2290     case AD_ELEC:
2291         if (u.umonnum == PM_FLESH_GOLEM)
2292             heal = (dam + 5) / 6; /* Approx 1 per die */
2293         break;
2294     case AD_FIRE:
2295         if (u.umonnum == PM_IRON_GOLEM)
2296             heal = dam;
2297         break;
2298     }
2299     if (heal && (u.mh < u.mhmax)) {
2300         u.mh += heal;
2301         if (u.mh > u.mhmax)
2302             u.mh = u.mhmax;
2303         context.botl = 1;
2304 /*JP
2305         pline("Strangely, you feel better than before.");
2306 */
2307         pline("\8aï\96­\82È\82±\82Æ\82É\81C\91O\82æ\82è\8bC\95ª\82ª\82æ\82­\82È\82Á\82½\81D");
2308         exercise(A_STR, TRUE);
2309     }
2310 }
2311
2312 STATIC_OVL int
2313 armor_to_dragon(atyp)
2314 int atyp;
2315 {
2316     switch (atyp) {
2317     case GRAY_DRAGON_SCALE_MAIL:
2318     case GRAY_DRAGON_SCALES:
2319         return PM_GRAY_DRAGON;
2320     case SILVER_DRAGON_SCALE_MAIL:
2321     case SILVER_DRAGON_SCALES:
2322         return PM_SILVER_DRAGON;
2323 #if 0 /* DEFERRED */
2324     case SHIMMERING_DRAGON_SCALE_MAIL:
2325     case SHIMMERING_DRAGON_SCALES:
2326         return PM_SHIMMERING_DRAGON;
2327 #endif
2328     case RED_DRAGON_SCALE_MAIL:
2329     case RED_DRAGON_SCALES:
2330         return PM_RED_DRAGON;
2331     case ORANGE_DRAGON_SCALE_MAIL:
2332     case ORANGE_DRAGON_SCALES:
2333         return PM_ORANGE_DRAGON;
2334     case WHITE_DRAGON_SCALE_MAIL:
2335     case WHITE_DRAGON_SCALES:
2336         return PM_WHITE_DRAGON;
2337     case BLACK_DRAGON_SCALE_MAIL:
2338     case BLACK_DRAGON_SCALES:
2339         return PM_BLACK_DRAGON;
2340     case BLUE_DRAGON_SCALE_MAIL:
2341     case BLUE_DRAGON_SCALES:
2342         return PM_BLUE_DRAGON;
2343     case GREEN_DRAGON_SCALE_MAIL:
2344     case GREEN_DRAGON_SCALES:
2345         return PM_GREEN_DRAGON;
2346     case YELLOW_DRAGON_SCALE_MAIL:
2347     case YELLOW_DRAGON_SCALES:
2348         return PM_YELLOW_DRAGON;
2349     default:
2350         return -1;
2351     }
2352 }
2353
2354 /*
2355  * Some species have awareness of other species
2356  */
2357 static boolean
2358 polysense(mptr)
2359 struct permonst *mptr;
2360 {
2361     short warnidx = 0;
2362
2363     context.warntype.speciesidx = 0;
2364     context.warntype.species = 0;
2365     context.warntype.polyd = 0;
2366
2367     switch (monsndx(mptr)) {
2368     case PM_PURPLE_WORM:
2369         warnidx = PM_SHRIEKER;
2370         break;
2371     case PM_VAMPIRE:
2372     case PM_VAMPIRE_LORD:
2373         context.warntype.polyd = M2_HUMAN | M2_ELF;
2374         HWarn_of_mon |= FROMRACE;
2375         return TRUE;
2376     }
2377     if (warnidx) {
2378         context.warntype.speciesidx = warnidx;
2379         context.warntype.species = &mons[warnidx];
2380         HWarn_of_mon |= FROMRACE;
2381         return TRUE;
2382     }
2383     context.warntype.speciesidx = 0;
2384     context.warntype.species = 0;
2385     HWarn_of_mon &= ~FROMRACE;
2386     return FALSE;
2387 }
2388
2389 /*polyself.c*/