-/* NetHack 3.6 weapon.c $NHDT-Date: 1548209744 2019/01/23 02:15:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.69 $ */
+/* 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-2019 */
+/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2022 */
/* JNetHack may be freely redistributed. See license for details. */
/*
/* note: entry [0] isn't used */
STATIC_VAR NEARDATA const char *const odd_skill_names[] = {
-#if 0 /*JP*/
+#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",
};
/* indexed vis `is_martial() */
STATIC_VAR NEARDATA const char *const barehands_or_martial[] = {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
"bare handed combat", "martial arts"
#else
"\91f\8eè", "\91Ì\8fp"
give_may_advance_msg(skill)
int skill;
{
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_feel("more confident in your %sskills.",
(skill == P_NONE) ? ""
: (skill <= P_LAST_WEAPON) ? "weapon "
#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*/
+#if 0 /*JP:T*/
pline("%s cannot wield that %s.", mon_nam(mon),
xname(obj));
#else
setmnotwielded(mon, mw_tmp);
mon->weapon_check = NEED_WEAPON;
if (canseemon(mon)) {
+ boolean newly_welded;
+
/*JP
pline("%s wields %s!", Monnam(mon), doname(obj));
*/
pline("%s\82Í%s\82ð\91\95\94õ\82µ\82½\81I", Monnam(mon), doname(obj));
- if (mwelded(mw_tmp)) {
-#if 0 /*JP*/
+ /* 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), mbodypart(mon, HAND));
+ 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*/
+#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));
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;
/* new state is only reported if it's an increase */
if (newspe > obj->spe) {
if (verbose) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
const char *wetness = (newspe < 3)
? (!obj->spe ? "damp" : "damper")
: (!obj->spe ? "wet" : "wetter");
#endif
if (carried(obj))
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s gets %s.", Yobjnam2(obj, (const char *) 0),
wetness);
#else
wetness);
#endif
else if (mcarried(obj) && canseemon(obj->ocarry))
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s gets %s.", s_suffix(Monnam(obj->ocarry)),
xname(obj), wetness);
#else
if (newspe < obj->spe) {
if (verbose) {
if (carried(obj))
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s dries%s.", Yobjnam2(obj, (const char *) 0),
!newspe ? " out" : "");
#else
!newspe ? "\8a£\82«\82«\82Á\82½" : "\8a£\82¢\82½");
#endif
else if (mcarried(obj) && canseemon(obj->ocarry))
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s drie%s.", s_suffix(Monnam(obj->ocarry)),
xname(obj), !newspe ? " out" : "");
#else
P_SKILL(skill)++;
u.skill_record[u.skills_advanced++] = skill;
/* subtly change the advance message to indicate no more advancement */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("are now %s skilled in %s.",
P_SKILL(skill) >= P_MAX_SKILL(skill) ? "most" : "more",
P_NAME(skill));
if (eventually_advance > 0 || maxxed_cnt > 0) {
any = zeroany;
if (eventually_advance > 0) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Sprintf(buf, "(Skill%s flagged by \"*\" may be enhanced %s.)",
plur(eventually_advance),
(u.ulevel < MAXULEV)
MENU_UNSELECTED);
}
if (maxxed_cnt > 0) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Sprintf(buf,
"(Skill%s flagged by \"#\" cannot be enhanced any further.)",
plur(maxxed_cnt));
MENU_UNSELECTED);
}
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Strcpy(buf, (to_advance > 0) ? "Pick a skill to advance:"
: "Current skills:");
#else
if (artifact_light(obj) && obj->lamplit) {
end_burn(obj, FALSE);
if (canseemon(mon))
-#if 0 /*JP*/
+#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"));