OSDN Git Service

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