OSDN Git Service

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