OSDN Git Service

update year to 2018
[jnethack/source.git] / src / polyself.c
index 5fb3b9a..7c0af05 100644 (file)
@@ -1,10 +1,10 @@
-/* NetHack 3.6 polyself.c      $NHDT-Date: 1448496566 2015/11/26 00:09:26 $  $NHDT-Branch: master $:$NHDT-Revision: 1.104 $ */
+/* NetHack 3.6 polyself.c      $NHDT-Date: 1520797126 2018/03/11 19:38:46 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.117 $ */
 /*      Copyright (C) 1987, 1988, 1989 by Ken Arromdee */
 /* NetHack may be freely redistributed.  See license for details. */
 
 /* JNetHack Copyright */
 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000  */
-/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2016            */
+/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2018            */
 /* JNetHack may be freely redistributed.  See license for details. */
 
 /*
@@ -33,7 +33,7 @@ STATIC_DCL void FDECL(drop_weapon, (int));
 STATIC_DCL void NDECL(uunstick);
 STATIC_DCL int FDECL(armor_to_dragon, (int));
 STATIC_DCL void NDECL(newman);
-STATIC_DCL boolean FDECL(polysense, (struct permonst *));
+STATIC_DCL void NDECL(polysense);
 
 STATIC_VAR const char no_longer_petrify_resistant[] =
 /*JP
@@ -50,6 +50,7 @@ void
 set_uasmon()
 {
     struct permonst *mdat = &mons[u.umonnum];
+    int new_speed, old_speed = youmonst.data ? youmonst.data->mmove : 0;
 
     set_mon_data(&youmonst, mdat, 0);
 
@@ -100,12 +101,21 @@ set_uasmon()
     PROPSET(PASSES_WALLS, passes_walls(mdat));
     PROPSET(REGENERATION, regenerates(mdat));
     PROPSET(REFLECTING, (mdat == &mons[PM_SILVER_DRAGON]));
+#undef PROPSET
 
     float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
+    polysense();
 
-#undef PROPSET
+    if (youmonst.movement) {
+        new_speed = mdat->mmove;
+        /* prorate unused movement if new form is slower so that
+           it doesn't get extra moves leftover from previous form;
+           if new form is faster, leave unused movement as is */
+        if (new_speed < old_speed)
+            youmonst.movement = new_speed * youmonst.movement / old_speed;
+    }
 
-#ifdef STATUS_VIA_WINDOWPORT
+#ifdef STATUS_HILITES
     status_initialize(REASSESS_ONLY);
 #endif
 }
@@ -120,6 +130,7 @@ float_vs_flight()
         BFlying |= I_SPECIAL;
     else
         BFlying &= ~I_SPECIAL;
+    context.botl = TRUE;
 }
 
 /* for changing into form that's immune to strangulation */
@@ -133,10 +144,18 @@ boolean on;
            vulnerable form into another causes the counter to be reset */
         if (uamul && uamul->otyp == AMULET_OF_STRANGULATION
             && can_be_strangled(&youmonst)) {
+            Strangled = 6L;
+            context.botl = TRUE;
+#if 0 /*JP*/
             Your("%s %s your %s!", simpleonames(uamul),
                  Strangled ? "still constricts" : "begins constricting",
                  body_part(NECK)); /* "throat" */
-            Strangled = 6L;
+#else
+            Your("%s%s%s\82ð\8di\82ß%s\81I", simpleonames(uamul),
+                 Strangled ? "\82Í\82Ü\82¾" : "\82ª",
+                 body_part(NECK),
+                 Strangled ? "\82Ä\82¢\82é" : "\82Í\82\82ß\82½");
+#endif
             makeknown(AMULET_OF_STRANGULATION);
         }
 
@@ -144,7 +163,11 @@ boolean on;
     } else {
         if (Strangled && !can_be_strangled(&youmonst)) {
             Strangled = 0L;
+            context.botl = TRUE;
+/*JP
             You("are no longer being strangled.");
+*/
+            You("\82à\82Í\82â\92\82\91§\82µ\82Ä\82¢\82È\82¢\81D");
         }
     }
 }
@@ -184,12 +207,7 @@ const char *fmt, *arg;
 
     You(fmt, arg);
     /* check whether player foolishly genocided self while poly'd */
-    if ((mvitals[urole.malenum].mvflags & G_GENOD)
-        || (urole.femalenum != NON_PM
-            && (mvitals[urole.femalenum].mvflags & G_GENOD))
-        || (mvitals[urace.malenum].mvflags & G_GENOD)
-        || (urace.femalenum != NON_PM
-            && (mvitals[urace.femalenum].mvflags & G_GENOD))) {
+    if (ugenocided()) {
         /* intervening activity might have clobbered genocide info */
         struct kinfo *kptr = find_delayed_killer(POLYMORPH);
 
@@ -364,7 +382,6 @@ newman()
             Strcpy(killer.name, "\95Ï\89»\82Ì\8e¸\94s\82Å");
             done(DIED);
             newuhs(FALSE);
-            (void) polysense(youmonst.data);
             return; /* lifesaved */
         }
     }
@@ -374,9 +391,11 @@ newman()
 */
     polyman("%s\82Æ\82µ\82Ä\90\82Ü\82ê\82©\82í\82Á\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81I",
             /* use saved gender we're about to revert to, not current */
-            (u.mfemale && urace.individual.f)
+            ((Upolyd ? u.mfemale : flags.female) && urace.individual.f)
                 ? urace.individual.f
-                : (urace.individual.m) ? urace.individual.m : urace.noun);
+                : (urace.individual.m)
+                   ? urace.individual.m
+                   : urace.noun);
     if (Slimed) {
 /*JP
         Your("body transforms, but there is still slime on you.");
@@ -385,7 +404,6 @@ newman()
         make_slimed(10L, (const char *) 0);
     }
 
-    (void) polysense(youmonst.data);
     context.botl = 1;
     see_monsters();
     (void) encumber_msg();
@@ -399,7 +417,7 @@ void
 polyself(psflags)
 int psflags;
 {
-    char buf[BUFSZ];
+    char buf[BUFSZ] = DUMMY;
     int old_light, new_light, mntmp, class, tryct;
     boolean forcecontrol = (psflags == 1), monsterpoly = (psflags == 2),
             draconian = (uarm && Is_dragon_armor(uarm)),
@@ -407,7 +425,10 @@ int psflags;
             controllable_poly = Polymorph_control && !(Stunned || Unaware);
 
     if (Unchanging) {
+/*JP
         pline("You fail to transform!");
+*/
+        pline("\82 \82È\82½\82Í\95Ï\89»\82É\8e¸\94s\82µ\82½\81I");
         return;
     }
     /* being Stunned|Unaware doesn't negate this aspect of Poly_control */
@@ -498,7 +519,10 @@ int psflags;
                     pm_name = the(pm_name);
                 else if (!type_is_pname(&mons[mntmp]))
                     pm_name = an(pm_name);
+/*JP
                 You_cant("polymorph into %s.", pm_name);
+*/
+                You_cant("%s\82É\95Ï\89»\82Å\82«\82È\82¢\81D", pm_name);
             } else
                 break;
         } while (--tryct > 0);
@@ -525,18 +549,29 @@ int psflags;
                     You("\97Ø\82Ì\8aZ\82Æ\88ê\91Ì\89»\82µ\82½\81D");
                 } else { /* dragon scale mail */
                     /* d.scale mail first reverts to scales */
+#if 0 /*JP*/
                     char *p, *dsmail;
+#else
+                    char *dsmail;
+#endif
 
                     /* similar to noarmor(invent.c),
                        shorten to "<color> scale mail" */
                     dsmail = strcpy(buf, simpleonames(uarm));
+#if 0 /*JP*/
                     if ((p = strstri(dsmail, " dragon ")) != 0)
                         while ((p[1] = p[8]) != '\0')
                             ++p;
+#endif
                     /* tricky phrasing; dragon scale mail
                        is singular, dragon scales are plural */
+#if 0 /*JP*/
                     Your("%s reverts to scales as you merge with them.",
                          dsmail);
+#else
+                    Your("%s\82Í\97Ø\82É\96ß\82Á\82½\81D",
+                         dsmail);
+#endif
                     /* uarm->spe enchantment remains unchanged;
                        re-converting scales to mail poses risk
                        of evaporation due to over enchanting */
@@ -563,7 +598,10 @@ int psflags;
                             ? PM_WOLF
                             : !rn2(4) ? PM_FOG_CLOUD : PM_VAMPIRE_BAT;
             if (controllable_poly) {
+/*JP
                 Sprintf(buf, "Become %s?", an(mons[mntmp].mname));
+*/
+                Sprintf(buf, "%s\82É\82È\82é\81H", mons[mntmp].mname);
                 if (yn(buf) != 'y')
                     return;
             }
@@ -619,6 +657,7 @@ int
 polymon(mntmp)
 int mntmp;
 {
+    char buf[BUFSZ];
     boolean sticky = sticks(youmonst.data) && u.ustuck && !u.uswallow,
             was_blind = !!Blind, dochange = FALSE;
     int mlvl;
@@ -673,35 +712,28 @@ int mntmp;
         if (sex_change_ok && !rn2(10))
             dochange = TRUE;
     }
+
+#if 0 /*JP*/
+    Strcpy(buf, (u.umonnum != mntmp) ? "" : "new ");
+#else /*\93ú\96{\8cê\82Æ\82µ\82Ä\95s\8e©\91R\82É\82È\82é\82Ì\82Å\88ê\92U\82»\82Ì\82Ü\82Ü\82É\82·\82é*/
+    Strcpy(buf, "");
+#endif
     if (dochange) {
         flags.female = !flags.female;
 #if 0 /*JP*/
-        You("%s %s%s!",
-            (u.umonnum != mntmp) ? "turn into a" : "feel like a new",
-            (is_male(&mons[mntmp]) || is_female(&mons[mntmp]))
-                ? ""
-                : flags.female ? "female " : "male ",
-            mons[mntmp].mname);
+        Strcat(buf, (is_male(&mons[mntmp]) || is_female(&mons[mntmp]))
+                       ? "" : flags.female ? "female " : "male ");
 #else
-        You("%s%s\82É\82È\82Á\82½%s\81I",
-            (is_male(&mons[mntmp]) || is_female(&mons[mntmp]))
-                ? ""
-                : flags.female ? "\8f\97\82Ì" : "\92j\82Ì",
-            mons[mntmp].mname,
-            (u.umonnum != mntmp) ? "" : "\82æ\82¤\82È\8bC\82ª\82µ\82½");
+        Strcat(buf, (is_male(&mons[mntmp]) || is_female(&mons[mntmp]))
+                       ? "" : flags.female ? "\8f\97\82Ì" : "\92j\82Ì");
 #endif
-    } else {
-        if (u.umonnum != mntmp)
-/*JP
-            You("turn into %s!", an(mons[mntmp].mname));
-*/
-            You("%s\82É\82È\82Á\82½\81I", mons[mntmp].mname);
-        else
+    }
+    Strcat(buf, mons[mntmp].mname);
 /*JP
-            You_feel("like a new %s!", mons[mntmp].mname);
+    You("%s %s!", (u.umonnum != mntmp) ? "turn into" : "feel like", an(buf));
 */
-            You("\95Ê\82Ì%s\82É\82È\82Á\82½\82æ\82¤\82È\8bC\82ª\82µ\82½\81I", mons[mntmp].mname);
-    }
+    You("%s%s\81I", an(buf), (u.umonnum != mntmp) ? "\82É\82È\82Á\82½" : "\82Ì\82æ\82¤\82È\8bC\82ª\82µ\82½");
+
     if (Stoned && poly_when_stoned(&mons[mntmp])) {
         /* poly_when_stoned already checked stone golem genocide */
         mntmp = PM_STONE_GOLEM;
@@ -803,11 +835,17 @@ int mntmp;
         uunstick();
     if (u.usteed) {
         if (touch_petrifies(u.usteed->data) && !Stone_resistance && rnl(3)) {
-            char buf[BUFSZ];
-
+#if 0 /*JP:T*/
             pline("%s touch %s.", no_longer_petrify_resistant,
                   mon_nam(u.usteed));
+#else
+            pline("%s\82Í%s\82É\90G\82ê\82½\81D", no_longer_petrify_resistant,
+                  mon_nam(u.usteed));
+#endif
+/*JP
             Sprintf(buf, "riding %s", an(u.usteed->data->mname));
+*/
+            Sprintf(buf, "%s\82É\8fæ\82Á\82Ä", u.usteed->data->mname);
             instapetrify(buf);
         }
         if (!can_ride(u.usteed))
@@ -825,42 +863,42 @@ int mntmp;
 /*JP
             pline(use_thec, monsterc, "use your breath weapon");
 */
-            pline(use_thec,monsterc, "\91§\82ð\93f\82«\82©\82¯\82é");
+            pline(use_thec, monsterc, "\91§\82ð\93f\82«\82©\82¯\82é");
         if (attacktype(youmonst.data, AT_SPIT))
 /*JP
             pline(use_thec, monsterc, "spit venom");
 */
-            pline(use_thec,monsterc, "\93Å\82ð\93f\82­");
+            pline(use_thec, monsterc, "\93Å\82ð\93f\82­");
         if (youmonst.data->mlet == S_NYMPH)
 /*JP
             pline(use_thec, monsterc, "remove an iron ball");
 */
-            pline(use_thec,monsterc, "\93S\8b\85\82ð\82Í\82¸\82·");
+            pline(use_thec, monsterc, "\93S\8b\85\82ð\82Í\82¸\82·");
         if (attacktype(youmonst.data, AT_GAZE))
 /*JP
             pline(use_thec, monsterc, "gaze at monsters");
 */
-            pline(use_thec,monsterc, "\89ö\95¨\82ðáÉ\82Þ");
+            pline(use_thec, monsterc, "\89ö\95¨\82ðáÉ\82Þ");
         if (is_hider(youmonst.data))
 /*JP
             pline(use_thec, monsterc, "hide");
 */
-            pline(use_thec,monsterc, "\89B\82ê\82é");
+            pline(use_thec, monsterc, "\89B\82ê\82é");
         if (is_were(youmonst.data))
 /*JP
             pline(use_thec, monsterc, "summon help");
 */
-            pline(use_thec,monsterc, "\92\87\8aÔ\82ð\8f¢\8a«\82·\82é");
+            pline(use_thec, monsterc, "\92\87\8aÔ\82ð\8f¢\8a«\82·\82é");
         if (webmaker(youmonst.data))
 /*JP
             pline(use_thec, monsterc, "spin a web");
 */
-            pline(use_thec,monsterc, "\82­\82à\82Ì\91\83\82ð\92£\82é");
+            pline(use_thec, monsterc, "\82­\82à\82Ì\91\83\82ð\92£\82é");
         if (u.umonnum == PM_GREMLIN)
 /*JP
             pline(use_thec, monsterc, "multiply in a fountain");
 */
-            pline(use_thec,monsterc, "\90ò\82Ì\92\86\82Å\95ª\97ô\82·\82é");
+            pline(use_thec, monsterc, "\90ò\82Ì\92\86\82Å\95ª\97ô\82·\82é");
         if (is_unicorn(youmonst.data))
 /*JP
             pline(use_thec, monsterc, "use your horn");
@@ -918,9 +956,9 @@ int mntmp;
                && u.utraptype == TT_LAVA) {
         u.utrap = 0;
 /*JP
-        pline_The("lava now feels soothing.");
+        pline_The("%s now feels soothing.", hliquid("lava"));
 */
-        pline("\97n\8aâ\82ª\90¸\90_\82ð\97\8e\82¿\82Â\82©\82¹\82Ä\82­\82ê\82é\81D");
+        pline_The("%s\82ª\90¸\90_\82ð\97\8e\82¿\82Â\82©\82¹\82Ä\82­\82ê\82é\81D", hliquid("\97n\8aâ"));
     }
     if (amorphous(youmonst.data) || is_whirly(youmonst.data)
         || unsolid(youmonst.data)) {
@@ -960,7 +998,6 @@ int mntmp;
         u.utrap = 0;
     }
     check_strangling(TRUE); /* maybe start strangling */
-    (void) polysense(youmonst.data);
 
     context.botl = 1;
     vision_full_recalc = 1;
@@ -1149,8 +1186,12 @@ drop_weapon(alone)
 int alone;
 {
     struct obj *otmp;
+#if 0 /*JP*/
     const char *what, *which, *whichtoo;
-    boolean candropwep, candropswapwep;
+#else
+    const char *which, *whichtoo;
+#endif
+    boolean candropwep, candropswapwep, updateinv = TRUE;
 
     if (uwep) {
         /* !alone check below is currently superfluous but in the
@@ -1161,35 +1202,57 @@ int alone;
             candropwep = canletgo(uwep, "");
             candropswapwep = !u.twoweap || canletgo(uswapwep, "");
             if (alone) {
+#if 0 /*JP*/
                 what = (candropwep && candropswapwep) ? "drop" : "release";
+#endif
+/*JP
                 which = is_sword(uwep) ? "sword" : weapon_descr(uwep);
+*/
+                which = is_sword(uwep) ? "\8c\95" : weapon_descr(uwep);
                 if (u.twoweap) {
                     whichtoo =
+/*JP
                         is_sword(uswapwep) ? "sword" : weapon_descr(uswapwep);
+*/
+                        is_sword(uswapwep) ? "\8c\95" : weapon_descr(uswapwep);
                     if (strcmp(which, whichtoo))
+/*JP
                         which = "weapon";
+*/
+                        which = "\95\90\8aí";
                 }
+#if 0 /*JP*//*\95¡\90\94\8c`\82É\82µ\82È\82¢*/
                 if (uwep->quan != 1L || u.twoweap)
                     which = makeplural(which);
+#endif
 
 #if 0 /*JP*/
                 You("find you must %s %s %s!", what,
                     the_your[!!strncmp(which, "corpse", 6)], which);
 #else
-                You("%s\82ð\97\8e\82Æ\82µ\82½\82±\82Æ\82É\8bC\82Ã\82¢\82½\81I", what);
+                You("%s\82ð\97\8e\82Æ\82µ\82½\82±\82Æ\82É\8bC\82Ã\82¢\82½\81I", which);
 #endif
             }
+            /* if either uwep or wielded uswapwep is flagged as 'in_use'
+               then don't drop it or explicitly update inventory; leave
+               those actions to caller (or caller's caller, &c) */
             if (u.twoweap) {
                 otmp = uswapwep;
                 uswapwepgone();
-                if (candropswapwep)
+                if (otmp->in_use)
+                    updateinv = FALSE;
+                else if (candropswapwep)
                     dropx(otmp);
             }
             otmp = uwep;
             uwepgone();
-            if (candropwep)
+            if (otmp->in_use)
+                updateinv = FALSE;
+            else if (candropwep)
                 dropx(otmp);
-            update_inventory();
+
+            if (updateinv)
+                update_inventory();
         } else if (!could_twoweap(youmonst.data)) {
             untwoweapon();
         }
@@ -1200,13 +1263,21 @@ void
 rehumanize()
 {
     /* You can't revert back while unchanging */
-    if (Unchanging && (u.mh < 1)) {
-        killer.format = NO_KILLER_PREFIX;
-/*JP
-        Strcpy(killer.name, "killed while stuck in creature form");
-*/
-        Strcpy(killer.name, "\8c³\82Ì\8ep\82Ö\96ß\82ê\82¸\82É");
-        done(DIED);
+    if (Unchanging) {
+        if (u.mh < 1) {
+#if 0 /*JP*/
+            killer.format = NO_KILLER_PREFIX;
+            Strcpy(killer.name, "killed while stuck in creature form");
+#else
+            killer.format = KILLED_BY;
+            Strcpy(killer.name, "\8c³\82Ì\8ep\82Ö\96ß\82ê\82¸\82É");
+#endif
+            done(DIED);
+        } else if (uamul && uamul->otyp == AMULET_OF_UNCHANGING) {
+            Your("%s %s!", simpleonames(uamul), otense(uamul, "fail"));
+            uamul->dknown = 1;
+            makeknown(AMULET_OF_UNCHANGING);
+        }
     }
 
     if (emits_light(youmonst.data))
@@ -1608,8 +1679,8 @@ dogaze()
 #endif
                     if (yn(qbuf) != 'y')
                         continue;
-                    setmangry(mtmp);
                 }
+                setmangry(mtmp, TRUE);
                 if (!mtmp->mcanmove || mtmp->mstun || mtmp->msleeping
                     || !mtmp->mcansee || !haseyes(mtmp->data)) {
                     looked--;
@@ -1664,24 +1735,31 @@ dogaze()
 
                 if (mtmp->data == &mons[PM_FLOATING_EYE] && !mtmp->mcan) {
                     if (!Free_action) {
-/*JP
+#if 0 /*JP*/
                         You("are frozen by %s gaze!",
-*/
-                        You("%s\82Ì\82É\82ç\82Ý\82Å\93®\82¯\82È\82­\82È\82Á\82½\81I", 
                             s_suffix(mon_nam(mtmp)));
+#else
+                        You("%s\82Ì\82É\82ç\82Ý\82Å\93®\82¯\82È\82­\82È\82Á\82½\81I", 
+                            mon_nam(mtmp));
+#endif
                         nomul((u.ulevel > 6 || rn2(4))
                                   ? -d((int) mtmp->m_lev + 1,
                                        (int) mtmp->data->mattk[0].damd)
                                   : -200);
+/*JP
                         multi_reason = "frozen by a monster's gaze";
+*/
+                        multi_reason = "\89ö\95¨\82Ì\82É\82ç\82Ý\82Å\8dd\92¼\82µ\82Ä\82¢\82é\8e\9e\82É";
                         nomovemsg = 0;
                         return 1;
                     } else
-/*JP
+#if 0 /*JP*/
                         You("stiffen momentarily under %s gaze.",
-*/
-                        You("%s\82Ì\82É\82ç\82Ý\82Å\88ê\8fu\8dd\92¼\82µ\82½\81D",
                             s_suffix(mon_nam(mtmp)));
+#else
+                        You("%s\82Ì\82É\82ç\82Ý\82Å\88ê\8fu\8dd\92¼\82µ\82½\81D",
+                            mon_nam(mtmp));
+#endif
                 }
                 /* Technically this one shouldn't affect you at all because
                  * the Medusa gaze is an active monster attack that only
@@ -1726,12 +1804,22 @@ dohide()
     /* can't hide while being held (or holding) or while trapped
        (except for floor hiders [trapper or mimic] in pits) */
     if (u.ustuck || (u.utrap && (u.utraptype != TT_PIT || on_ceiling))) {
+#if 0 /*JP:T*/
         You_cant("hide while you're %s.",
-                 !u.ustuck ? "trapped" : !sticks(youmonst.data)
-                                             ? "being held"
-                                             : humanoid(u.ustuck->data)
-                                                   ? "holding someone"
-                                                   : "holding that creature");
+                 !u.ustuck ? "trapped"
+                   : u.uswallow ? (is_animal(u.ustuck->data) ? "swallowed"
+                                                             : "engulfed")
+                     : !sticks(youmonst.data) ? "being held"
+                       : (humanoid(u.ustuck->data) ? "holding someone"
+                                                   : "holding that creature"));
+#else
+        You_cant("%s\8aÔ\82Í\89B\82ê\82ç\82ê\82È\82¢\81D",
+                 !u.ustuck ? "\95ß\82Ü\82Á\82Ä\82¢\82é"
+                   : u.uswallow ? "\88ù\82Ý\8d\9e\82Ü\82ê\82Ä\82¢\82é"
+                   : !sticks(youmonst.data) ? "\95ß\82Ü\82¦\82ç\82ê\82Ä\82¢\82é"
+                     : humanoid(u.ustuck->data) ? "\92N\82©\82ð\82Â\82©\82ñ\82Å\82¢\82é"
+                                                : "\89ö\95¨\82ð\82Â\82©\82ñ\82Å\82¢\82é");
+#endif
         if (u.uundetected
             || (ismimic && youmonst.m_ap_type != M_AP_NOTHING)) {
             u.uundetected = 0;
@@ -1744,26 +1832,41 @@ dohide()
        such critters aren't offered the option of hiding via #monster */
     if (youmonst.data->mlet == S_EEL && !is_pool(u.ux, u.uy)) {
         if (IS_FOUNTAIN(levl[u.ux][u.uy].typ))
+/*JP
             The("fountain is not deep enough to hide in.");
+*/
+            The("\90ò\82Í\89B\82ê\82ç\82ê\82é\82Ù\82Ç\90[\82­\82È\82¢\81D");
         else
-            There("is no water to hide in here.");
+/*JP
+            There("is no %s to hide in here.", hliquid("water"));
+*/
+            There("\82±\82±\82É\82Í\89B\82ê\82é\82½\82ß\82Ì%s\82ª\82È\82¢\81D", hliquid("\90\85"));
         u.uundetected = 0;
         return 0;
     }
     if (hides_under(youmonst.data) && !level.objects[u.ux][u.uy]) {
+/*JP
         There("is nothing to hide under here.");
+*/
+        There("\82±\82±\82É\82Í\89B\82ê\82ç\82ê\82é\82à\82Ì\82ª\82È\82¢\81D");
         u.uundetected = 0;
         return 0;
     }
     /* Planes of Air and Water */
     if (on_ceiling && !has_ceiling(&u.uz)) {
+/*JP
         There("is nowhere to hide above you.");
+*/
+        There("\82 \82È\82½\82Ì\8fã\82É\82Í\89B\82ê\82ç\82ê\82é\8fê\8f\8a\82ª\82È\82¢\81D");
         u.uundetected = 0;
         return 0;
     }
     if ((is_hider(youmonst.data) && !Flying) /* floor hider */
         && (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz))) {
+/*JP
         There("is nowhere to hide beneath you.");
+*/
+        There("\82 \82È\82½\82Ì\89º\82É\82Í\89B\82ê\82ç\82ê\82é\8fê\8f\8a\82ª\82È\82¢\81D");
         u.uundetected = 0;
         return 0;
     }
@@ -1795,7 +1898,10 @@ dopoly()
     if (is_vampire(youmonst.data)) {
         polyself(2);
         if (savedat != youmonst.data) {
+/*JP
             You("transform into %s.", an(youmonst.data->mname));
+*/
+            You("%s\82Ì\8ep\82É\82È\82Á\82½\81D", youmonst.data->mname);
             newsym(u.ux, u.uy);
         }
     }
@@ -1894,7 +2000,8 @@ int part;
                               "spine",     "toe",  "hair",         "blood",
                               "lung",      "nose", "stomach" },
 #else
-        *humanoid_parts[] = { "\98r", "\96Ú", "\8aç", "\8ew",
+        *humanoid_parts[] = {
+            "\98r", "\96Ú", "\8aç", "\8ew",
             "\8ew\90æ", "\91«", "\8eè", "\8eè\82É\82·\82é",
             "\93ª", "\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
             "\94w\8d\9c", "\92Ü\90æ", "\94¯",  "\8c\8c",
@@ -1909,13 +2016,14 @@ int part;
                            "ripples", "juices", "surface", "sensor",
                            "stomach" },
 #else
-    *jelly_parts[] = { "\8b[\8e\97\90G\8eè", "\8d\95\82¢\94Á\93_", "\91O\96Ê",
-        "\8b[\8e\97\90G\8eè\82Ì\90æ", "\8b[\8e\97\90G\8eè",
-        "\8b[\8e\97\90G\8eè\82Ì\8a²", "\90G\8eè", "\88¬\82é",
-        "\94]\82Ì\97Ì\88æ", "\89º\95û\82Ì\8b[\8e\97\90G\8eè", "\82Ë\82Î\82Ë\82Î\82µ\82Ä\82«\82½",
-        "\92\86\8aÔ\97Ì\88æ", "\95\\96Ê",  "\8b[\8e\97\90G\8eè",
-        "\94g\96ä", "\91Ì\89t", "\95\\96Ê", "\8a´\8ao\8aí",
-        "\88Ý"},
+        *jelly_parts[] = {
+            "\8b[\8e\97\90G\8eè", "\8d\95\82¢\94Á\93_", "\91O\96Ê",
+            "\8b[\8e\97\90G\8eè\82Ì\90æ", "\8b[\8e\97\90G\8eè",
+            "\8b[\8e\97\90G\8eè\82Ì\8a²", "\90G\8eè", "\88¬\82é",
+            "\94]\82Ì\97Ì\88æ", "\89º\95û\82Ì\8b[\8e\97\90G\8eè", "\82Ë\82Î\82Ë\82Î\82µ\82Ä\82«\82½",
+            "\92\86\8aÔ\97Ì\88æ", "\95\\96Ê",  "\8b[\8e\97\90G\8eè",
+            "\94g\96ä", "\91Ì\89t", "\95\\96Ê", "\8a´\8ao\8aí",
+            "\88Ý"},
 #endif
 #if 0 /*JP*/
         *animal_parts[] = { "forelimb",  "eye",           "face",
@@ -1926,13 +2034,14 @@ int part;
                             "blood",     "lung",          "nose",
                             "stomach" },
 #else
-    *animal_parts[] = { "\91O\91«", "\96Ú", "\8aç",
-        "\91O\92Ü", "\92Ü\90æ", "\8cã\92Ü",
-        "\91O\92Ü", "\82Ð\82Á\82©\82¯\82é", "\93ª",
-        "\8cã\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
-        "\94w\8d\9c", "\8cã\92Ü\90æ", "\96Ñ\94ç",
-        "\8c\8c", "\94x", "\95@",
-        "\88Ý"},
+        *animal_parts[] = {
+            "\91O\91«", "\96Ú", "\8aç",
+            "\91O\92Ü", "\92Ü\90æ", "\8cã\92Ü",
+            "\91O\92Ü", "\82Ð\82Á\82©\82¯\82é", "\93ª",
+            "\8cã\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
+            "\94w\8d\9c", "\8cã\92Ü\90æ", "\96Ñ\94ç",
+            "\8c\8c", "\94x", "\95@",
+            "\88Ý"},
 #endif
 #if 0 /*JP*/
         *bird_parts[] = { "wing",     "eye",  "face",         "wing",
@@ -1941,11 +2050,12 @@ int part;
                           "spine",    "toe",  "feathers",     "blood",
                           "lung",     "bill", "stomach" },
 #else
-    *bird_parts[] = { "\97\83", "\96Ú", "\8aç", "\97\83",
-        "\97\83\82Ì\90æ", "\91«", "\97\83", "\97\83\82É\82Æ\82é",
-        "\93ª", "\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
-        "\94w\8d\9c", "\92Ü\90æ", "\89H\96Ñ", "\8c\8c",
-        "\94x", "\82­\82¿\82Î\82µ", "\88Ý" },
+        *bird_parts[] = {
+            "\97\83", "\96Ú", "\8aç", "\97\83",
+            "\97\83\82Ì\90æ", "\91«", "\97\83", "\97\83\82É\82Æ\82é",
+            "\93ª", "\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
+            "\94w\8d\9c", "\92Ü\90æ", "\89H\96Ñ", "\8c\8c",
+            "\94x", "\82­\82¿\82Î\82µ", "\88Ý" },
 #endif
 #if 0 /*JP*/
         *horse_parts[] = { "foreleg",  "eye",           "face",
@@ -1956,13 +2066,14 @@ int part;
                            "blood",    "lung",          "nose",
                            "stomach" },
 #else
-    *horse_parts[] = { "\91O\91«", "\96Ú", "\8aç",
-        "\91O\92û", "\92û", "\8cã\92û",
-        "\91O\92Ü", "\92û\82É\82Í\82³\82Þ", "\93ª",
-        "\8cã\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
-        "\94w\8d\9c", "\8cã\92Ü\90æ", "\82½\82Ä\82ª\82Ý",
-        "\8c\8c", "\94x", "\95@",
-        "\88Ý" },
+        *horse_parts[] = {
+            "\91O\91«", "\96Ú", "\8aç",
+            "\91O\92û", "\92û", "\8cã\92û",
+            "\91O\92Ü", "\92û\82É\82Í\82³\82Þ", "\93ª",
+            "\8cã\91«", "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ",
+            "\94w\8d\9c", "\8cã\92Ü\90æ", "\82½\82Ä\82ª\82Ý",
+            "\8c\8c", "\94x", "\95@",
+            "\88Ý" },
 #endif
 #if 0 /*JP*/
         *sphere_parts[] = { "appendage", "optic nerve", "body", "tentacle",
@@ -1972,7 +2083,8 @@ int part;
                             "lower tentacle tip", "cilia", "life force",
                             "retina", "olfactory nerve", "interior" },
 #else
-        *sphere_parts[] = { "\93Ë\8bN", "\8e\8b\8ao\90_\8co", "\91Ì", "\90G\8eè",
+        *sphere_parts[] = {
+            "\93Ë\8bN", "\8e\8b\8ao\90_\8co", "\91Ì", "\90G\8eè",
             "\90G\8eè\82Ì\90æ", "\89º\82Ì\93Ë\8bN", "\90G\8eè",
             "\90G\8eè\82É\8e\9d\82Â", "\91Ì", "\89º\82Ì\90G\8eè",
             "\89ñ\93]\82µ\82½", "\92\86\90S\90ü", "\91Ì",
@@ -1988,7 +2100,8 @@ int part;
                             "juices",   "gill",        "gill",
                             "interior" },
 #else
-        *fungus_parts[] = { "\8bÛ\8e\85\91Ì", "\8e\8b\8ao\97Ì\88æ", "\91O",
+        *fungus_parts[] = {
+            "\8bÛ\8e\85\91Ì", "\8e\8b\8ao\97Ì\88æ", "\91O",
             "\8bÛ\8e\85", "\8bÛ\8e\85", "\8dª",
             "\90G\8eè", "\90G\8eè\82É\82©\82ç\82Ý\82Â\82¯\82é", "\8eP",
             "\8dª\8cs", "\8d¬\97\90\82·\82é", "\8e²",
@@ -2005,7 +2118,8 @@ int part;
                             "life force",    "center",        "leading edge",
                             "interior" },
 #else
-        *vortex_parts[] = { "\97Ì\88æ", "\96Ú", "\91O",
+        *vortex_parts[] = {
+            "\97Ì\88æ", "\96Ú", "\91O",
             "\8f¬\82³\82¢\97¬\82ê", "\8f¬\82³\82¢\97¬\82ê", "\89º\95\94\82Ì\97¬\82ê",
             "\89Q\8aª", "\89Q\82É\8aª\82­", "\89Q\82Ì\92\86\90S",
             "\89º\95\94\82Ì\97¬\82ê", "\8d¬\97\90\82µ\82½", "\92\86\90S\95\94",
@@ -2021,7 +2135,8 @@ int part;
                            "scales", "blood", "lung", "forked tongue",
                            "stomach" },
 #else
-        *snake_parts[] = { "\91Þ\89»\82µ\82½\91«", "\96Ú", "\8aç", "\91å\82«\82È\97Ø",
+        *snake_parts[] = {
+            "\91Þ\89»\82µ\82½\91«", "\96Ú", "\8aç", "\91å\82«\82È\97Ø",
             "\91å\82«\82È\97Ø\82Ì\90æ", "\8cã\95\94\95ª", "\97Ø\82Ì\8c\84\8aÔ",
             "\97Ø\82Ì\8c\84\8aÔ\82É\82Â\82¯\82é", "\93ª", "\8cã\95\94\95ª",
             "\82ß\82Ü\82¢\82ª\82µ\82½", "\8eñ", "\91Ì", "\8cã\95\94\95ª\82Ì\8aZ",
@@ -2036,12 +2151,13 @@ int part;
                           "length", "posterior setae", "setae", "blood",
                           "skin", "prostomium", "stomach" },
 #else
-        *worm_parts[] = { "\91O\8bæ", "\8a´\8cõ\90«\8d×\96E",
-                          "\8aÂ\91Ñ", "\8ap", "\8ap", "\8cã\8bæ",
-                          "\90ß", "\90ß\82É\82Â\82¯\82é", "\91O\8bæ",
-                          "\8cã\95\94", "\90L\82Ñ\82·\82¬\82½", "\8aÂ\91Ñ",
-                          "\91Ì", "\8cã\95\94\82Ì\8ap", "\8ap", "\8c\8c",
-                          "\94ç\95\86", "\8cû\91O\97t", "\88Ý" },
+        *worm_parts[] = {
+            "\91O\8bæ", "\8a´\8cõ\90«\8d×\96E",
+            "\8aÂ\91Ñ", "\8ap", "\8ap", "\8cã\8bæ",
+            "\90ß", "\90ß\82É\82Â\82¯\82é", "\91O\8bæ",
+            "\8cã\95\94", "\90L\82Ñ\82·\82¬\82½", "\8aÂ\91Ñ",
+            "\91Ì", "\8cã\95\94\82Ì\8ap", "\8ap", "\8c\8c",
+            "\94ç\95\86", "\8cû\91O\97t", "\88Ý" },
 #endif
 #if 0 /*JP*/
         *fish_parts[] = { "fin", "eye", "premaxillary", "pelvic axillary",
@@ -2050,7 +2166,8 @@ int part;
                           "dorsal fin", "caudal fin", "scales", "blood",
                           "gill", "nostril", "stomach" };
 #else
-        *fish_parts[] = { "\82Ð\82ê", "\96Ú", "\8aç", "\82Ð\82ê\82Ì\90æ",
+        *fish_parts[] = {
+            "\82Ð\82ê", "\96Ú", "\8aç", "\82Ð\82ê\82Ì\90æ",
             "\82Ð\82ê\82Ì\90æ", "\94ö\82Ñ\82ê", "\8b¹\82Ð\82ê", "\82Ð\82ê\82Å\8e\9d\82Â",
             "\93ª", "\94ö\95¿", "\82ß\82Ü\82¢\82ª\82µ\82½", "\82¦\82ç",
             "\94w\82Ñ\82ê", "\94ö\82Ñ\82ê", "\97Ø", "\8c\8c",
@@ -2145,7 +2262,10 @@ int part;
 #endif
     }
     if (mptr == &mons[PM_STALKER] && part == HEAD)
+/*JP
         return "head";
+*/
+        return "\93ª";
     if (mptr->mlet == S_EEL && mptr != &mons[PM_JELLYFISH])
         return fish_parts[part];
     if (mptr->mlet == S_WORM)
@@ -2261,20 +2381,18 @@ int atyp;
     }
 }
 
-/*
- * Some species have awareness of other species
- */
-static boolean
-polysense(mptr)
-struct permonst *mptr;
+/* some species have awareness of other species */
+static void
+polysense()
 {
-    short warnidx = 0;
+    short warnidx = NON_PM;
 
-    context.warntype.speciesidx = 0;
+    context.warntype.speciesidx = NON_PM;
     context.warntype.species = 0;
     context.warntype.polyd = 0;
+    HWarn_of_mon &= ~FROMRACE;
 
-    switch (monsndx(mptr)) {
+    switch (u.umonnum) {
     case PM_PURPLE_WORM:
         warnidx = PM_SHRIEKER;
         break;
@@ -2282,18 +2400,48 @@ struct permonst *mptr;
     case PM_VAMPIRE_LORD:
         context.warntype.polyd = M2_HUMAN | M2_ELF;
         HWarn_of_mon |= FROMRACE;
-        return TRUE;
+        return;
     }
-    if (warnidx) {
+    if (warnidx >= LOW_PM) {
         context.warntype.speciesidx = warnidx;
         context.warntype.species = &mons[warnidx];
         HWarn_of_mon |= FROMRACE;
-        return TRUE;
     }
-    context.warntype.speciesidx = 0;
-    context.warntype.species = 0;
-    HWarn_of_mon &= ~FROMRACE;
-    return FALSE;
+}
+
+/* True iff hero's role or race has been genocided */
+boolean
+ugenocided()
+{
+    return (boolean) ((mvitals[urole.malenum].mvflags & G_GENOD)
+                      || (urole.femalenum != NON_PM
+                          && (mvitals[urole.femalenum].mvflags & G_GENOD))
+                      || (mvitals[urace.malenum].mvflags & G_GENOD)
+                      || (urace.femalenum != NON_PM
+                          && (mvitals[urace.femalenum].mvflags & G_GENOD)));
+}
+
+/* how hero feels "inside" after self-genocide of role or race */
+const char *
+udeadinside()
+{
+    /* self-genocide used to always say "you feel dead inside" but that
+       seems silly when you're polymorphed into something undead;
+       monkilled() distinguishes between living (killed) and non (destroyed)
+       for monster death message; we refine the nonliving aspect a bit */
+#if 0 /*JP*/
+    return !nonliving(youmonst.data)
+             ? "dead"          /* living, including demons */
+             : !weirdnonliving(youmonst.data)
+                 ? "condemned" /* undead plus manes */
+                 : "empty";    /* golems plus vortices */
+#else
+    return !nonliving(youmonst.data)
+             ? "\8e\80\82ñ\82¾"          /* \90\95¨\82Æ\88«\96\82 */
+             : !weirdnonliving(youmonst.data)
+                 ? "\94j\89ó\82³\82ê\82½"  /* \83A\83\93\83f\83b\83h\82Æ\96S\97ì */
+                 : "\82È\82­\82È\82Á\82½"; /* \83S\81[\83\8c\83\80\82Æ\89Q */
+#endif
 }
 
 /*polyself.c*/