From 38cea51d15701858b11a745a0b8471454e86effd Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Fri, 11 Feb 2011 02:25:59 +0000 Subject: [PATCH] enlightenment/status feedback about wielded weapons (trunk only) I noticed "you were wielding two weapons at once" in end of game disclosure from a newsgroup ascension post for the Spork variant and thought we ought to show that too. Well we already do. This moves it from an attribute entry for magical enlightenment to a status entry for ^X display since it's something the hero and the player should already always know. In the process I added feedback for being weaponless and then went further and added some feedback about what weapon is wielded. This is stuff that could/would be shown on the status line if there were room, and fits with the post-3.4.3 ^X expansion of cryptic status stuff. The "new ^X output" entry in the new features section of fixes35.0 covers this too. --- src/cmd.c | 23 ++++++++++++++++++++++- src/weapon.c | 7 ++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/cmd.c b/src/cmd.c index a733663e4..9dd418b82 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -1571,6 +1571,28 @@ int final; /* last resort entry, guarantees Status section is non-empty */ you_are("unencumbered", ""); } + /* report being weaponless; distinguish whether gloves are worn */ + if (!uwep) you_are(uarmg ? "empty handed" : /* gloves imply hands */ + /* no weapon and no gloves */ + humanoid(youmonst.data) ? "bare handed" : + /* alternate phrasing for paws or lack of hands */ + "not wielding anything", ""); + /* two-weaponing implies a weapon (not other odd stuff) in each hand */ + else if (u.twoweap) you_are("wielding two weapons at once", ""); + /* report most weapons by their skill class (so a katana will be + described as a long sword, for instance; mattock and hook are + exceptions), or wielded non-weapon item by its object class */ + else { + const char *what = weapon_descr(uwep); + + if (!strcmpi(what, "armor") || !strcmpi(what, "food") || + !strcmpi(what, "venom")) + Sprintf(buf, "wielding some %s", what); + else + Sprintf(buf, "wielding %s", + (uwep->quan == 1L) ? an(what) : makeplural(what)); + you_are(buf, ""); + } } /* attributes: intrinsics and the like, other non-obvious capabilities */ @@ -1787,7 +1809,6 @@ int final; if (Fixed_abil) you_have("fixed abilities",from_what(FIXED_ABIL)); if (Lifesaved) enl_msg("Your life ", "will be", "would have been", " saved",""); - if (u.twoweap) you_are("wielding two weapons at once",""); /*** Miscellany ***/ if (Luck) { diff --git a/src/weapon.c b/src/weapon.c index 2044aee4c..f7586d6ce 100644 --- a/src/weapon.c +++ b/src/weapon.c @@ -1,5 +1,4 @@ /* NetHack 3.5 weapon.c $Date$ $Revision$ */ -/* SCCS Id: @(#)weapon.c 3.5 2009/01/20 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -113,8 +112,10 @@ struct obj *obj; /* assorted special cases */ switch (skill) { case P_NONE: - /* not a weapon: use item class name; override "food" for corpses */ - descr = (obj->otyp == CORPSE || obj->otyp == TIN || obj->otyp == EGG) ? + /* not a weapon: use item class name; override "food" for corpses, + tins, and eggs and "large rock" for statues and boulders */ + descr = (obj->otyp == CORPSE || obj->otyp == TIN || obj->otyp == EGG || + obj->otyp == STATUE || obj->otyp == BOULDER) ? OBJ_NAME(objects[obj->otyp]) : def_oc_syms[(int)obj->oclass].name; break; -- 2.50.1