-/* NetHack 3.6 wield.c $NHDT-Date: 1543492132 2018/11/29 11:48:52 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.58 $ */
+/* NetHack 3.6 wield.c $NHDT-Date: 1559670611 2019/06/04 17:50:11 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.59 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2009. */
/* 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-2020 */
/* JNetHack may be freely redistributed. See license for details. */
#include "hack.h"
return FALSE;
/* Prevent wielding cockatrice when not wearing gloves --KAA */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("wield %s in your bare %s.",
corpse_xname(obj, (const char *) 0, CXN_PFX_THE),
makeplural(body_part(HAND)));
/* hero must have been life-saved to get here; use a turn */
res++; /* corpse won't be wielded */
} else if (uarms && bimanual(wep)) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("cannot wield a two-handed %s while wearing a shield.",
is_sword(wep) ? "sword" : wep->otyp == BATTLE_AXE ? "axe"
: "weapon");
pline("%s\82Í\8f\9f\8eè\82É\82 \82È\82½\82Ì%s\82É\91\95\94õ\82³\82ê\82½\81D",
xname(wep), body_part(HAND));
#endif
- wep->bknown = TRUE;
+ set_bknown(wep, 1);
} else {
/* The message must be printed before setuwep (since
* you might die and be revived from changing weapons),
if (artifact_light(wep) && !wep->lamplit) {
begin_burn(wep, FALSE);
if (!Blind)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s to shine %s!", Tobjnam(wep, "begin"),
arti_light_description(wep));
#else
if ((this_shkp = shop_keeper(inside_shop(u.ux, u.uy)))
!= (struct monst *) 0) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s says \"You be careful with my %s!\"",
shkname(this_shkp), xname(wep));
#else
Sprintf(qbuf, "You are wielding %ld %s. Ready %ld of them?",
uwep->quan, simpleonames(uwep), uwep->quan - 1L);
#else
- Sprintf(qbuf, "\82 \82È\82½\82Í%ld %s\82ð\91\95\94õ\82µ\82Ä\82¢\82é\81D\82»\82Ì\82¤\82¿ %ld \82ð\8f\80\94õ\82·\82é\81H",
- uwep->quan, simpleonames(uwep), uwep->quan - 1L);
+ Sprintf(qbuf, "\82 \82È\82½\82Í%ld%s\82Ì%s\82ð\91\95\94õ\82µ\82Ä\82¢\82é\81D\82»\82Ì\82¤\82¿%ld%s\82ð\8f\80\94õ\82·\82é\81H",
+ uwep->quan, numeral(uwep), simpleonames(uwep),
+ uwep->quan - 1L, numeral(uwep));
#endif
switch (ynq(qbuf)) {
case 'q':
/* require confirmation to ready the main weapon */
if (ynq(qbuf) != 'y') {
(void) Shk_Your(qbuf, uwep); /* replace qbuf[] contents */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s%s %s wielded.", qbuf,
simpleonames(uwep), otense(uwep, "remain"));
#else
: "Your alternate weapon is",
uswapwep->quan, simpleonames(uswapwep),
uswapwep->quan - 1L);
-#else /*TODO:\93ñ\93\81\97¬\82Ì\82Æ\82«\82Í\82©\82È\82è\95s\8e©\91R */
- Sprintf(qbuf, "%s %ld %s\82¾\81D\82»\82Ì\82¤\82¿%ld\82ð\8f\80\94õ\82·\82é\81H",
- u.twoweap ? "\82 \82È\82½\82ª\82»\82ê\82¼\82ê\91\95\94õ\82µ\82Ä\82¢\82é\82Ì\82Í"
- : "\82 \82È\82½\82Ì\97\\94õ\82Ì\95\90\8aí\82Í",
- uswapwep->quan, simpleonames(uswapwep),
- uswapwep->quan - 1L);
+#else
+ Sprintf(qbuf, "\82 \82È\82½%s\82Í%ld%s\82Ì%s\82¾\81D\82»\82Ì\82¤\82¿%ld%s\82ð\8f\80\94õ\82·\82é\81H",
+ u.twoweap ? "\82ª\93ñ\93\81\97¬\82Å\91\95\94õ\82µ\82Ä\82¢\82é\82Ì"
+ : "\82Ì\97\\94õ\82Ì\95\90\8aí",
+ uswapwep->quan, numeral(uswapwep), simpleonames(uswapwep),
+ uswapwep->quan - 1L, numeral(uswapwep));
#endif
switch (ynq(qbuf)) {
case 'q':
/* require confirmation to ready the alternate weapon */
if (ynq(qbuf) != 'y') {
(void) Shk_Your(qbuf, uswapwep); /* replace qbuf[] contents */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s%s %s %s.", qbuf,
simpleonames(uswapwep), otense(uswapwep, "remain"),
u.twoweap ? "wielded" : "as secondary weapon");
#endif
if (obj->owornmask & (W_ARMOR | W_ACCESSORY)) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You_cant("%s %s while wearing %s.", verb, yname(obj),
more_than_1 ? "them" : "it");
#else
}
/* check shield */
if (uarms && bimanual(obj)) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
You("cannot %s a two-handed %s while wearing a shield.", verb,
(obj->oclass == WEAPON_CLASS) ? "weapon" : "tool");
#else
*/
You("\8f\82\82ð\8e\9d\82Á\82Ä\82¢\82é\8aÔ\82Í\97¼\8eè\8e\9d\82¿\82Å\82«\82È\82¢\81D");
else if (uswapwep->oartifact)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s being held second to another weapon!",
Yobjnam2(uswapwep, "resist"));
#else
; /* must be life-saved to reach here; return FALSE */
} else if (Glib || uswapwep->cursed) {
if (!Glib)
- uswapwep->bknown = TRUE;
+ set_bknown(uswapwep, 1);
drop_uswapwep();
} else
return TRUE;
register struct obj *otmp;
register int amount;
{
- const char *color = hcolor((amount < 0) ? NH_BLACK : NH_BLUE);
+ const char *color = hcolor_adv((amount < 0) ? NH_BLACK : NH_BLUE);
const char *xtime, *wepname = "";
boolean multiple;
int otyp = STRANGE_OBJECT;
if (amount >= 0 && uwep && will_weld(uwep)) { /* cursed tin opener */
if (!Blind) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Sprintf(buf, "%s with %s aura.",
Yobjnam2(uwep, "glow"), an(hcolor(NH_AMBER)));
#else
Sprintf(buf, "%s\82Í%s\83I\81[\83\89\82É\82Â\82Â\82Ü\82ê\82½\81D",
xname(uwep), hcolor(NH_AMBER));
#endif
- uwep->bknown = !Hallucination;
+ uwep->bknown = !Hallucination; /* ok to bypass set_bknown() */
} else {
/* cursed tin opener is wielded in right hand */
/*JP
uncurse(uwep);
update_inventory();
} else {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Sprintf(buf, "Your %s %s.", makeplural(body_part(HAND)),
(amount >= 0) ? "twitch" : "itch");
#else
if (uwep->otyp == WORM_TOOTH && amount >= 0) {
multiple = (uwep->quan > 1L);
/* order: message, transformation, shop handling */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Your("%s %s much sharper now.", simpleonames(uwep),
multiple ? "fuse, and become" : "is");
#else
} else if (uwep->otyp == CRYSKNIFE && amount < 0) {
multiple = (uwep->quan > 1L);
/* order matters: message, shop handling, transformation */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Your("%s %s much duller now.", simpleonames(uwep),
multiple ? "fuse, and become" : "is");
#else
/*JP
pline("%s %s.", Yobjnam2(uwep, "faintly glow"), color);
*/
- Your("%s\82Í\82í\82¸\82©\82É%s\8bP\82¢\82½\81D", xname(uwep),jconj_adj(color));
+ Your("%s\82Í\82í\82¸\82©\82É%s\8bP\82¢\82½\81D", xname(uwep), color);
return 1;
}
/* there is a (soft) upper and lower limit to uwep->spe */
if (((uwep->spe > 5 && amount >= 0) || (uwep->spe < -5 && amount < 0))
&& rn2(3)) {
if (!Blind)
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s for a while and then %s.",
Yobjnam2(uwep, "violently glow"), color,
otense(uwep, "evaporate"));
#else
Your("%s\82Í\82µ\82Î\82ç\82\8c\83\82µ\82%s\8bP\82«\81C\8fö\94\82µ\82½\81D",
- xname(uwep), jconj_adj(color));
+ xname(uwep), color);
#endif
else
/*JP
xtime = (amount * amount == 1) ? "moment" : "while";
*/
xtime = (amount*amount == 1) ? "\88ê\8fu" : "\82µ\82Î\82ç\82\82Ì\8aÔ";
-#if 0 /*JP*/
+#if 0 /*JP:T*/
pline("%s %s for a %s.",
Yobjnam2(uwep, amount == 0 ? "violently glow" : "glow"), color,
xtime);
#else
Your("%s\82Í%s%s%s\8bP\82¢\82½\81D",
- xname(uwep), xtime, jconj_adj(color),
+ xname(uwep), xtime, color,
amount == 0 ? "\8c\83\82µ\82" : "");
#endif
if (otyp != STRANGE_OBJECT && uwep->known
* spe dependent. Give an obscure clue here.
*/
if (uwep->oartifact == ART_MAGICBANE && uwep->spe >= 0) {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
Your("right %s %sches!", body_part(HAND),
(((amount > 1) && (uwep->spe > 1)) ? "flin" : "it"));
#else
register struct obj *obj;
{
if (obj && obj == uwep && will_weld(obj)) {
- obj->bknown = TRUE;
+ set_bknown(obj, 1);
return 1;
}
return 0;