OSDN Git Service

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