OSDN Git Service

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