OSDN Git Service

upgrade to 3.6.7
[jnethack/source.git] / src / weapon.c
index cc14f35..bcf4de3 100644 (file)
@@ -1,14 +1,27 @@
-/* NetHack 3.6 weapon.c        $NHDT-Date: 1446078767 2015/10/29 00:32:47 $  $NHDT-Branch: master $:$NHDT-Revision: 1.55 $ */
+/* NetHack 3.6 weapon.c        $NHDT-Date: 1559998716 2019/06/08 12:58:36 $  $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.70 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
+/*-Copyright (c) Robert Patrick Rankin, 2011. */
 /* 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-2022            */
+/* JNetHack may be freely redistributed.  See license for details. */
+
 /*
  *      This module contains code for calculation of "to hit" and damage
  *      bonuses for any given weapon used, as well as weapons selection
  *      code for monsters.
  */
+
 #include "hack.h"
 
+STATIC_DCL void FDECL(give_may_advance_msg, (int));
+STATIC_DCL boolean FDECL(could_advance, (int));
+STATIC_DCL boolean FDECL(peaked_skill, (int));
+STATIC_DCL int FDECL(slots_required, (int));
+STATIC_DCL void FDECL(skill_advance, (int));
+
 /* Categories whose names don't come from OBJ_NAME(objects[type])
  */
 #define PN_BARE_HANDED (-1) /* includes martial arts */
@@ -26,8 +39,6 @@
 #define PN_ESCAPE_SPELL (-13)
 #define PN_MATTER_SPELL (-14)
 
-STATIC_DCL void FDECL(give_may_advance_msg, (int));
-
 STATIC_VAR NEARDATA const short skill_names_indices[P_NUM_SKILLS] = {
     0, DAGGER, KNIFE, AXE, PICK_AXE, SHORT_SWORD, BROADSWORD, LONG_SWORD,
     TWO_HANDED_SWORD, SCIMITAR, PN_SABER, CLUB, MACE, MORNING_STAR, FLAIL,
@@ -40,35 +51,27 @@ STATIC_VAR NEARDATA const short skill_names_indices[P_NUM_SKILLS] = {
 
 /* note: entry [0] isn't used */
 STATIC_VAR NEARDATA const char *const odd_skill_names[] = {
+#if 0 /*JP:T*/
     "no skill", "bare hands", /* use barehands_or_martial[] instead */
     "two weapon combat", "riding", "polearms", "saber", "hammer", "whip",
     "attack spells", "healing spells", "divination spells",
     "enchantment spells", "clerical spells", "escape spells", "matter spells",
+#else
+    "no skill", "\91f\8eè", /* use barehands_or_martial[] instead */
+    "\93ñ\93\81\97¬", "\8bR\8fæ", "\92·\95\80", "\83T\81[\83x\83\8b", "\83n\83\93\83}\81[", "\95Ú",
+    "\8dU\8c\82", "\8e¡\96ü", "\97\\92m",
+    "\95â\8f\95", "\91m\97µ", "\92E\8fo", "\95¨\8e¿",
+#endif
 };
 /* indexed vis `is_martial() */
 STATIC_VAR NEARDATA const char *const barehands_or_martial[] = {
+#if 0 /*JP:T*/
     "bare handed combat", "martial arts"
+#else
+    "\91f\8eè", "\91Ì\8fp"
+#endif
 };
 
-STATIC_OVL void
-give_may_advance_msg(skill)
-int skill;
-{
-    You_feel("more confident in your %sskills.",
-             skill == P_NONE ? "" : skill <= P_LAST_WEAPON
-                                        ? "weapon "
-                                        : skill <= P_LAST_SPELL
-                                              ? "spell casting "
-                                              : "fighting ");
-}
-
-STATIC_DCL boolean FDECL(can_advance, (int, BOOLEAN_P));
-STATIC_DCL boolean FDECL(could_advance, (int));
-STATIC_DCL boolean FDECL(peaked_skill, (int));
-STATIC_DCL int FDECL(slots_required, (int));
-STATIC_DCL char *FDECL(skill_level_name, (int, char *));
-STATIC_DCL void FDECL(skill_advance, (int));
-
 #define P_NAME(type)                                    \
     ((skill_names_indices[type] > 0)                    \
          ? OBJ_NAME(objects[skill_names_indices[type]]) \
@@ -79,6 +82,25 @@ STATIC_DCL void FDECL(skill_advance, (int));
 static NEARDATA const char kebabable[] = { S_XORN, S_DRAGON, S_JABBERWOCK,
                                            S_NAGA, S_GIANT,  '\0' };
 
+STATIC_OVL void
+give_may_advance_msg(skill)
+int skill;
+{
+#if 0 /*JP:T*/
+    You_feel("more confident in your %sskills.",
+             (skill == P_NONE) ? ""
+                 : (skill <= P_LAST_WEAPON) ? "weapon "
+                     : (skill <= P_LAST_SPELL) ? "spell casting "
+                         : "fighting ");
+#else
+    You("%s\83X\83L\83\8b\82ð\8d\82\82ß\82é\8e©\90M\82ª\97N\82¢\82Ä\82«\82½\81D",
+        (skill == P_NONE) ? ""
+            : (skill <= P_LAST_WEAPON) ? "\95\90\8aí\82Ì"
+                : (skill <= P_LAST_SPELL) ? "\96\82\96@\82Ì"
+                    : "\90í\82¢\82Ì");
+#endif
+}
+
 /* weapon's skill category name for use as generalized description of weapon;
    mostly used to shorten "you drop your <weapon>" messages when slippery
    fingers or polymorph causes hero to involuntarily drop wielded weapon(s) */
@@ -104,29 +126,47 @@ struct obj *obj;
     case P_SLING:
         if (is_ammo(obj))
             descr = (obj->otyp == ROCK || is_graystone(obj))
+/*JP
                         ? "stone"
+*/
+                        ? "\90Î"
                         /* avoid "rock"; what about known glass? */
                         : (obj->oclass == GEM_CLASS)
+/*JP
                             ? "gem"
+*/
+                            ? "\95ó\90Î"
                             /* in case somebody adds odd sling ammo */
                             : def_oc_syms[(int) obj->oclass].name;
         break;
     case P_BOW:
         if (is_ammo(obj))
+/*JP
             descr = "arrow";
+*/
+            descr = "\96î";
         break;
     case P_CROSSBOW:
         if (is_ammo(obj))
+/*JP
             descr = "bolt";
+*/
+            descr = "\83{\83\8b\83g";
         break;
     case P_FLAIL:
         if (obj->otyp == GRAPPLING_HOOK)
+/*JP
             descr = "hook";
+*/
+            descr = "\83t\83b\83N";
         break;
     case P_PICK_AXE:
         /* even if "dwarvish mattock" hasn't been discovered yet */
         if (obj->otyp == DWARVISH_MATTOCK)
+/*JP
             descr = "mattock";
+*/
+            descr = "\82Â\82é\82Í\82µ";
         break;
     default:
         break;
@@ -304,12 +344,12 @@ struct monst *mon;
     if (ptr == &mons[PM_SHADE] && !shade_glare(otmp))
         tmp = 0;
 
-    /* "very heavy iron ball"; weight increase is in increments of 160 */
+    /* "very heavy iron ball"; weight increase is in increments */
     if (otyp == HEAVY_IRON_BALL && tmp > 0) {
         int wt = (int) objects[HEAVY_IRON_BALL].oc_weight;
 
         if ((int) otmp->owt > wt) {
-            wt = ((int) otmp->owt - wt) / 160;
+            wt = ((int) otmp->owt - wt) / IRON_BALL_W_INCR;
             tmp += rnd(4 * wt);
             if (tmp > 25)
                 tmp = 25; /* objects[].oc_wldam */
@@ -328,6 +368,8 @@ struct monst *mon;
             bonus += rnd(4);
         if (objects[otyp].oc_material == SILVER && mon_hates_silver(mon))
             bonus += rnd(20);
+        if (artifact_light(otmp) && otmp->lamplit && hates_light(ptr))
+            bonus += rnd(8);
 
         /* if the weapon is going to get a double damage bonus, adjust
            this bonus so that effectively it's added after the doubling */
@@ -351,6 +393,128 @@ struct monst *mon;
     return  tmp;
 }
 
+/* check whether blessed and/or silver damage applies for *non-weapon* hit;
+   return value is the amount of the extra damage */
+int
+special_dmgval(magr, mdef, armask, silverhit_p)
+struct monst *magr, *mdef;
+long armask; /* armor mask, multiple bits accepted for W_ARMC|W_ARM|W_ARMU
+              * or W_ARMG|W_RINGL|W_RINGR only */
+long *silverhit_p; /* output flag mask for silver bonus */
+{
+    struct obj *obj;
+    struct permonst *ptr = mdef->data;
+    boolean left_ring = (armask & W_RINGL) ? TRUE : FALSE,
+            right_ring = (armask & W_RINGR) ? TRUE : FALSE;
+    long silverhit = 0L;
+    int bonus = 0;
+
+    obj = 0;
+    if (armask & (W_ARMC | W_ARM | W_ARMU)) {
+        if ((armask & W_ARMC) != 0L
+            && (obj = which_armor(magr, W_ARMC)) != 0)
+            armask = W_ARMC;
+        else if ((armask & W_ARM) != 0L
+                 && (obj = which_armor(magr, W_ARM)) != 0)
+            armask = W_ARM;
+        else if ((armask & W_ARMU) != 0L
+                 && (obj = which_armor(magr, W_ARMU)) != 0)
+            armask = W_ARMU;
+        else
+            armask = 0L;
+    } else if (armask & (W_ARMG | W_RINGL | W_RINGR)) {
+        armask = ((obj = which_armor(magr, W_ARMG)) != 0) ?  W_ARMG : 0L;
+    } else {
+        obj = which_armor(magr, armask);
+    }
+
+    if (obj) {
+        if (obj->blessed
+            && (is_undead(ptr) || is_demon(ptr) || is_vampshifter(mdef)))
+            bonus += rnd(4);
+        /* the only silver armor is shield of reflection (silver dragon
+           scales refer to color, not material) and the only way to hit
+           with one--aside from throwing--is to wield it and perform a
+           weapon hit, but we include a general check here */
+        if (objects[obj->otyp].oc_material == SILVER
+            && mon_hates_silver(mdef)) {
+            bonus += rnd(20);
+            silverhit |= armask;
+        }
+
+    /* when no gloves we check for silver rings (blessed rings ignored) */
+    } else if ((left_ring || right_ring) && magr == &youmonst) {
+        if (left_ring && uleft) {
+            if (objects[uleft->otyp].oc_material == SILVER
+                && mon_hates_silver(mdef)) {
+                bonus += rnd(20);
+                silverhit |= W_RINGL;
+            }
+        }
+        if (right_ring && uright) {
+            if (objects[uright->otyp].oc_material == SILVER
+                && mon_hates_silver(mdef)) {
+                /* two silver rings don't give double silver damage
+                   but 'silverhit' messages might be adjusted for them */
+                if (!(silverhit & W_RINGL))
+                    bonus += rnd(20);
+                silverhit |= W_RINGR;
+            }
+        }
+    }
+
+    if (silverhit_p)
+        *silverhit_p = silverhit;
+    return bonus;
+}
+
+/* give a "silver <item> sears <target>" message;
+   not used for weapon hit, so we only handle rings */
+void
+silver_sears(magr, mdef, silverhit)
+struct monst *magr UNUSED;
+struct monst *mdef;
+long silverhit;
+{
+#if 0 /*JP*/
+    char rings[20]; /* plenty of room for "rings" */
+#endif
+    int ltyp = ((uleft && (silverhit & W_RINGL) != 0L)
+                ? uleft->otyp : STRANGE_OBJECT),
+        rtyp = ((uright && (silverhit & W_RINGR) != 0L)
+                ? uright->otyp : STRANGE_OBJECT);
+    boolean both,
+        l_ag = (objects[ltyp].oc_material == SILVER && uleft->dknown),
+        r_ag = (objects[rtyp].oc_material == SILVER && uright->dknown);
+
+    if ((silverhit & (W_RINGL | W_RINGR)) != 0L) {
+        /* plural if both the same type (so not multi_claw and both rings
+           are non-Null) and either both known or neither known, or both
+           silver (in case there is ever more than one type of silver ring)
+           and both known; singular if multi_claw (where one of ltyp or
+           rtyp will always be STRANGE_OBJECT) even if both rings are known
+           silver [see hmonas(uhitm.c) for explanation of 'multi_claw'] */
+        both = ((ltyp == rtyp && uleft->dknown == uright->dknown)
+                || (l_ag && r_ag));
+#if 0 /*JP*/
+        Sprintf(rings, "ring%s", both ? "s" : "");
+        Your("%s%s %s %s!",
+             (l_ag || r_ag) ? "silver "
+             : both ? ""
+               : ((silverhit & W_RINGL) != 0L) ? "left "
+                 : "right ",
+             rings, vtense(rings, "sear"), mon_nam(mdef));
+#else
+        Your("%s\8ew\97Ö\82ª%s\82ð\8fÄ\82¢\82½\81I",
+             (l_ag || r_ag) ? "\8bâ\82Ì"
+             : both ? ""
+               : ((silverhit & W_RINGL) != 0L) ? "\8d\82Ì"
+                 : "\89E\82Ì",
+             mon_nam(mdef));
+#endif
+    }
+}
+
 STATIC_DCL struct obj *FDECL(oselect, (struct monst *, int));
 #define Oselect(x)                      \
     if ((otmp = oselect(mtmp, x)) != 0) \
@@ -374,6 +538,7 @@ int x;
     return (struct obj *) 0;
 }
 
+/* TODO: have monsters use aklys' throw-and-return */
 static NEARDATA const int rwep[] = {
     DWARVISH_SPEAR, SILVER_SPEAR, ELVEN_SPEAR, SPEAR, ORCISH_SPEAR, JAVELIN,
     SHURIKEN, YA, SILVER_ARROW, ELVEN_ARROW, ARROW, ORCISH_ARROW,
@@ -402,7 +567,7 @@ register struct monst *mtmp;
 
     char mlet = mtmp->data->mlet;
 
-    propellor = &zeroobj;
+    propellor = (struct obj *) &zeroobj;
     Oselect(EGG);      /* cockatrice egg */
     if (mlet == S_KOP) /* pies are first choice for Kops */
         Oselect(CREAM_PIE);
@@ -461,25 +626,25 @@ register struct monst *mtmp;
         }
 
         /* KMH -- This belongs here so darts will work */
-        propellor = &zeroobj;
+        propellor = (struct obj *) &zeroobj;
 
-        prop = (objects[rwep[i]]).oc_skill;
+        prop = objects[rwep[i]].oc_skill;
         if (prop < 0) {
             switch (-prop) {
             case P_BOW:
-                propellor = (oselect(mtmp, YUMI));
+                propellor = oselect(mtmp, YUMI);
                 if (!propellor)
-                    propellor = (oselect(mtmp, ELVEN_BOW));
+                    propellor = oselect(mtmp, ELVEN_BOW);
                 if (!propellor)
-                    propellor = (oselect(mtmp, BOW));
+                    propellor = oselect(mtmp, BOW);
                 if (!propellor)
-                    propellor = (oselect(mtmp, ORCISH_BOW));
+                    propellor = oselect(mtmp, ORCISH_BOW);
                 break;
             case P_SLING:
-                propellor = (oselect(mtmp, SLING));
+                propellor = oselect(mtmp, SLING);
                 break;
             case P_CROSSBOW:
-                propellor = (oselect(mtmp, CROSSBOW));
+                propellor = oselect(mtmp, CROSSBOW);
             }
             if ((otmp = MON_WEP(mtmp)) && mwelded(otmp) && otmp != propellor
                 && mtmp->weapon_check == NO_WEAPON_WANTED)
@@ -511,6 +676,19 @@ register struct monst *mtmp;
     return (struct obj *) 0;
 }
 
+/* is 'obj' a type of weapon that any monster knows how to throw? */
+boolean
+monmightthrowwep(obj)
+struct obj *obj;
+{
+    short idx;
+
+    for (idx = 0; idx < SIZE(rwep); ++idx)
+        if (obj->otyp == rwep[idx])
+            return TRUE;
+    return FALSE;
+}
+
 /* Weapons in order of preference */
 static const NEARDATA short hwep[] = {
     CORPSE, /* cockatrice corpse */
@@ -588,11 +766,17 @@ boolean polyspot;
         mon->weapon_check = NO_WEAPON_WANTED;
         obj_extract_self(obj);
         if (cansee(mon->mx, mon->my)) {
+/*JP
             pline("%s drops %s.", Monnam(mon), distant_name(obj, doname));
+*/
+            pline("%s\82Í%s\82ð\92u\82¢\82½\81D", Monnam(mon), distant_name(obj, doname));
             newsym(mon->mx, mon->my);
         }
         /* might be dropping object into water or lava */
+/*JP
         if (!flooreffects(obj, mon->mx, mon->my, "drop")) {
+*/
+        if (!flooreffects(obj, mon->mx, mon->my, "\97\8e\82¿\82é")) {
             if (polyspot)
                 bypass_obj(obj);
             place_object(obj, mon->mx, mon->my);
@@ -668,6 +852,7 @@ register struct monst *mon;
     }
     if (obj && obj != &zeroobj) {
         struct obj *mw_tmp = MON_WEP(mon);
+
         if (mw_tmp && mw_tmp->otyp == obj->otyp) {
             /* already wielding it */
             mon->weapon_check = NEED_WEAPON;
@@ -680,22 +865,41 @@ register struct monst *mon;
          */
         if (mw_tmp && mwelded(mw_tmp)) {
             if (canseemon(mon)) {
+#if 0 /*JP*/
                 char welded_buf[BUFSZ];
+#endif
                 const char *mon_hand = mbodypart(mon, HAND);
 
                 if (bimanual(mw_tmp))
                     mon_hand = makeplural(mon_hand);
+#if 0 /*JP*/
                 Sprintf(welded_buf, "%s welded to %s %s",
                         otense(mw_tmp, "are"), mhis(mon), mon_hand);
+#endif
 
                 if (obj->otyp == PICK_AXE) {
+#if 0 /*JP*/
                     pline("Since %s weapon%s %s,", s_suffix(mon_nam(mon)),
                           plur(mw_tmp->quan), welded_buf);
+#else
+                    pline("%s\82Í\95\90\8aí\82ð\8eè\82É\82µ\82æ\82¤\82Æ\82µ\82½\82ª\81C", mon_nam(mon));
+#endif
+#if 0 /*JP:T*/
                     pline("%s cannot wield that %s.", mon_nam(mon),
                           xname(obj));
+#else
+                    pline("%s\82Í%s\82ð\91\95\94õ\82Å\82«\82È\82©\82Á\82½\81D", mon_nam(mon),
+                          xname(obj));
+#endif
                 } else {
+/*JP
                     pline("%s tries to wield %s.", Monnam(mon), doname(obj));
+*/
+                    pline("%s\82Í%s\82ð\91\95\94õ\82µ\82æ\82¤\82Æ\82µ\82½\81D", Monnam(mon), doname(obj));
+/*JP
                     pline("%s %s!", Yname2(mw_tmp), welded_buf);
+*/
+                    pline("%s\82Í%s\82ð\8eè\82É\82µ\82½\81I", Monnam(mon), xname(mw_tmp));
                 }
                 mw_tmp->bknown = 1;
             }
@@ -706,20 +910,62 @@ register struct monst *mon;
         setmnotwielded(mon, mw_tmp);
         mon->weapon_check = NEED_WEAPON;
         if (canseemon(mon)) {
+            boolean newly_welded;
+
+/*JP
             pline("%s wields %s!", Monnam(mon), doname(obj));
-            if (mwelded(mw_tmp)) {
+*/
+            pline("%s\82Í%s\82ð\91\95\94õ\82µ\82½\81I", Monnam(mon), doname(obj));
+            /* 3.6.3: mwelded() predicate expects the object to have its
+               W_WEP bit set in owormmask, but the pline here and for
+               artifact_light don't want that because they'd have '(weapon
+               in hand/claw)' appended; so we set it for the mwelded test
+               and then clear it, until finally setting it for good below */
+            obj->owornmask |= W_WEP;
+            newly_welded = mwelded(obj);
+            obj->owornmask &= ~W_WEP;
+            if (newly_welded) {
+                const char *mon_hand = mbodypart(mon, HAND);
+
+                if (bimanual(obj))
+                    mon_hand = makeplural(mon_hand);
+#if 0 /*JP:T*/
                 pline("%s %s to %s %s!", Tobjnam(obj, "weld"),
                       is_plural(obj) ? "themselves" : "itself",
-                      s_suffix(mon_nam(mon)), mbodypart(mon, HAND));
+                      s_suffix(mon_nam(mon)), mon_hand);
+#else
+                pline("%s\82Í\8f\9f\8eè\82É%s\82Ì%s\82É\91\95\94õ\82³\82ê\82½\81I",
+                      xname(obj),
+                      mon_nam(mon), mon_hand);
+#endif
                 obj->bknown = 1;
             }
         }
         if (artifact_light(obj) && !obj->lamplit) {
             begin_burn(obj, FALSE);
             if (canseemon(mon))
+#if 0 /*JP:T*/
                 pline("%s %s in %s %s!", Tobjnam(obj, "shine"),
                       arti_light_description(obj), s_suffix(mon_nam(mon)),
                       mbodypart(mon, HAND));
+#else
+                pline("%s\82Í%s\82Ì%s\82Ì\92\86\82Å%s\8bP\82¢\82½\81I",
+                      xname(obj), mon_nam(mon),
+                      mbodypart(mon, HAND), arti_light_description(obj));
+#endif
+            /* 3.6.3: artifact might be getting wielded by invisible monst */
+            else if (cansee(mon->mx, mon->my))
+#if 0 /*JP*/
+                pline("Light begins shining %s.",
+                      (distu(mon->mx, mon->my) <= 5 * 5)
+                          ? "nearby"
+                          : "in the distance");
+#else
+                pline("\96¾\82©\82è\82ª%s\82Å\8bP\82«\82Í\82\82ß\82½\81D",
+                      (distu(mon->mx, mon->my) <= 5 * 5)
+                          ? "\8bß\82­"
+                          : "\89\93\82­");
+#endif
         }
         obj->owornmask = W_WEP;
         return 1;
@@ -818,16 +1064,32 @@ boolean verbose;
     /* new state is only reported if it's an increase */
     if (newspe > obj->spe) {
         if (verbose) {
+#if 0 /*JP:T*/
             const char *wetness = (newspe < 3)
                                      ? (!obj->spe ? "damp" : "damper")
                                      : (!obj->spe ? "wet" : "wetter");
+#else
+            const char *wetness = (newspe < 3)
+                                     ? (!obj->spe ? "\8e¼\82Á\82½" : "\82³\82ç\82É\8e¼\82Á\82½")
+                                     : (!obj->spe ? "\94G\82ê\82½" : "\82³\82ç\82É\94G\82ê\82½");
+#endif
 
             if (carried(obj))
+#if 0 /*JP:T*/
                 pline("%s gets %s.", Yobjnam2(obj, (const char *) 0),
                       wetness);
+#else
+                pline("%s\82Í%s\81D", Yobjnam2(obj, (const char *) 0),
+                      wetness);
+#endif
             else if (mcarried(obj) && canseemon(obj->ocarry))
+#if 0 /*JP:T*/
                 pline("%s %s gets %s.", s_suffix(Monnam(obj->ocarry)),
                       xname(obj), wetness);
+#else
+                pline("%s\82Ì%s\82Í%s\81D", Monnam(obj->ocarry),
+                      xname(obj), wetness);
+#endif
         }
     }
     obj->spe = min(newspe, 7);
@@ -851,11 +1113,21 @@ boolean verbose;
     if (newspe < obj->spe) {
         if (verbose) {
             if (carried(obj))
+#if 0 /*JP:T*/
                 pline("%s dries%s.", Yobjnam2(obj, (const char *) 0),
                       !newspe ? " out" : "");
+#else
+                pline("%s\82Í%s\81D", Yobjnam2(obj, (const char *) 0),
+                      !newspe ? "\8a£\82«\82«\82Á\82½" : "\8a£\82¢\82½");
+#endif
             else if (mcarried(obj) && canseemon(obj->ocarry))
+#if 0 /*JP:T*/
                 pline("%s %s drie%s.", s_suffix(Monnam(obj->ocarry)),
                       xname(obj), !newspe ? " out" : "");
+#else
+                pline("%s\82Ì%s\82Í%s\81D", Monnam(obj->ocarry),
+                      xname(obj), !newspe ? "\8a£\82«\82«\82Á\82½" : "\8a£\82¢\82½");
+#endif
         }
     }
     newspe = min(newspe, 7);
@@ -868,7 +1140,7 @@ boolean verbose;
 }
 
 /* copy the skill level name into the given buffer */
-STATIC_OVL char *
+char *
 skill_level_name(skill, buf)
 int skill;
 char *buf;
@@ -877,32 +1149,60 @@ char *buf;
 
     switch (P_SKILL(skill)) {
     case P_UNSKILLED:
+/*JP
         ptr = "Unskilled";
+*/
+        ptr = "\8f\89\90S\8eÒ";
         break;
     case P_BASIC:
+/*JP
         ptr = "Basic";
+*/
+        ptr = "\93ü\96å\8eÒ";
         break;
     case P_SKILLED:
+/*JP
         ptr = "Skilled";
+*/
+        ptr = "\8fn\97û\8eÒ";
         break;
     case P_EXPERT:
+/*JP
         ptr = "Expert";
+*/
+        ptr = "\83G\83L\83X\83p\81[\83g";
         break;
     /* these are for unarmed combat/martial arts only */
     case P_MASTER:
+/*JP
         ptr = "Master";
+*/
+        ptr = "\83}\83X\83^\81[";
         break;
     case P_GRAND_MASTER:
+/*JP
         ptr = "Grand Master";
+*/
+        ptr = "\83O\83\89\83\93\83h\83}\83X\83^\81[";
         break;
     default:
+/*JP
         ptr = "Unknown";
+*/
+        ptr = "\95s\96¾";
         break;
     }
     Strcpy(buf, ptr);
     return buf;
 }
 
+const char *
+skill_name(skill)
+int skill;
+{
+    return P_NAME(skill);
+}
+
 /* return the # of slots required to advance the skill */
 STATIC_OVL int
 slots_required(skill)
@@ -929,8 +1229,7 @@ int skill;
 }
 
 /* return true if this skill can be advanced */
-/*ARGSUSED*/
-STATIC_OVL boolean
+boolean
 can_advance(skill, speedy)
 int skill;
 boolean speedy;
@@ -984,18 +1283,33 @@ int skill;
     P_SKILL(skill)++;
     u.skill_record[u.skills_advanced++] = skill;
     /* subtly change the advance message to indicate no more advancement */
+#if 0 /*JP:T*/
     You("are now %s skilled in %s.",
         P_SKILL(skill) >= P_MAX_SKILL(skill) ? "most" : "more",
         P_NAME(skill));
+#else
+    Your("%s\82Ì\83X\83L\83\8b\82ð%s\8d\82\82ß\82½\81D", 
+         P_NAME(skill),
+         P_SKILL(skill) >= P_MAX_SKILL(skill) ? "\8dÅ\8d\82\82É" : "\82³\82ç\82É");
+#endif
 }
 
 static const struct skill_range {
     short first, last;
     const char *name;
 } skill_ranges[] = {
+/*JP
     { P_FIRST_H_TO_H, P_LAST_H_TO_H, "Fighting Skills" },
+*/
+    { P_FIRST_H_TO_H, P_LAST_H_TO_H, "\90í\82¢\82Ì\83X\83L\83\8b" },
+/*JP
     { P_FIRST_WEAPON, P_LAST_WEAPON, "Weapon Skills" },
+*/
+    { P_FIRST_WEAPON, P_LAST_WEAPON, "\95\90\8aí\82Ì\83X\83L\83\8b" },
+/*JP
     { P_FIRST_SPELL, P_LAST_SPELL, "Spellcasting Skills" },
+*/
+    { P_FIRST_SPELL,  P_LAST_SPELL,  "\96\82\96@\82Ì\83X\83L\83\8b" },
 };
 
 /*
@@ -1044,18 +1358,30 @@ enhance_weapon_skill()
         if (eventually_advance > 0 || maxxed_cnt > 0) {
             any = zeroany;
             if (eventually_advance > 0) {
+#if 0 /*JP:T*/
                 Sprintf(buf, "(Skill%s flagged by \"*\" may be enhanced %s.)",
                         plur(eventually_advance),
                         (u.ulevel < MAXULEV)
                             ? "when you're more experienced"
                             : "if skill slots become available");
+#else
+                Sprintf(buf, "(\"*\"\82ª\82Â\82¢\82Ä\82¢\82é\83X\83L\83\8b\82Í%s\8d\82\82ß\82ç\82ê\82é\81D)",
+                        (u.ulevel < MAXULEV)
+                            ? "\82à\82Á\82Æ\8co\8c±\82ð\82Â\82ß\82Î"
+                            : "\83X\83L\83\8b\83X\83\8d\83b\83g\82ª\8eg\82¦\82é\82æ\82¤\82É\82È\82ê\82Î");
+#endif
                 add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, buf,
                          MENU_UNSELECTED);
             }
             if (maxxed_cnt > 0) {
+#if 0 /*JP:T*/
                 Sprintf(buf,
                  "(Skill%s flagged by \"#\" cannot be enhanced any further.)",
                         plur(maxxed_cnt));
+#else
+                Sprintf(buf,
+                        "(\"#\"\82ª\82Â\82¢\82Ä\82¢\82é\83X\83L\83\8b\82Í\82±\82ê\88È\8fã\8d\82\82ß\82ç\82ê\82È\82¢\81D)");
+#endif
                 add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, buf,
                          MENU_UNSELECTED);
             }
@@ -1119,8 +1445,13 @@ enhance_weapon_skill()
                          MENU_UNSELECTED);
             }
 
+#if 0 /*JP:T*/
         Strcpy(buf, (to_advance > 0) ? "Pick a skill to advance:"
                                      : "Current skills:");
+#else
+        Strcpy(buf, (to_advance > 0) ? "\83X\83L\83\8b\82ð\91I\91ð\82µ\82Ä\82­\82¾\82³\82¢\81F"
+                                     : "\8c»\8dÝ\82Ì\83X\83L\83\8b\81F");
+#endif
         if (wizard && !speedy)
             Sprintf(eos(buf), "  (%d slot%s available)", u.weapon_slots,
                     plur(u.weapon_slots));
@@ -1135,7 +1466,10 @@ enhance_weapon_skill()
             for (n = i = 0; i < P_NUM_SKILLS; i++) {
                 if (can_advance(i, speedy)) {
                     if (!speedy)
+/*JP
                         You_feel("you could be more dangerous!");
+*/
+                        You("\82³\82ç\82É\83X\83L\83\8b\82ð\8d\82\82ß\82é\82±\82Æ\82ª\82Å\82«\82»\82¤\82È\8bC\82ª\82µ\82½\81I");
                     n++;
                     break;
                 }
@@ -1147,7 +1481,7 @@ enhance_weapon_skill()
 
 /*
  * Change from restricted to unrestricted, allowing P_BASIC as max.  This
- * function may be called with with P_NONE.  Used in pray.c.
+ * function may be called with with P_NONE.  Used in pray.c as well as below.
  */
 void
 unrestrict_weapon_skill(skill)
@@ -1501,6 +1835,10 @@ const struct def_skill *class_skill;
             P_ADVANCE(skill) = practice_needed_to_advance(P_SKILL(skill) - 1);
         }
     }
+
+    /* each role has a special spell; allow at least basic for its type
+       (despite the function name, this works for spell skills too) */
+    unrestrict_weapon_skill(spell_skilltype(urole.spelspec));
 }
 
 void
@@ -1513,9 +1851,14 @@ register struct obj *obj;
     if (artifact_light(obj) && obj->lamplit) {
         end_burn(obj, FALSE);
         if (canseemon(mon))
+#if 0 /*JP:T*/
             pline("%s in %s %s %s shining.", The(xname(obj)),
                   s_suffix(mon_nam(mon)), mbodypart(mon, HAND),
                   otense(obj, "stop"));
+#else
+            pline("%s\82ª\8e\9d\82Â%s\82Ì\8bP\82«\82ª\8fÁ\82¦\82½\81D",
+                  mon_nam(mon), xname(obj));
+#endif
     }
     if (MON_WEP(mon) == obj)
         MON_NOWEP(mon);