change looting to choose ":iobrs nq" action from a menu for menustyle:Partial
wand/spell/breath zaps that reached the edge of the level on the Plane of Air
and "vanished into the aether" left temporary display effects on screen
+stop amulets and other items which aren't affected by erosion damage from
+ being subjected to erosion damage
Platform- and/or Interface-Specific Fixes
-/* NetHack 3.6 extern.h $NHDT-Date: 1457397476 2016/03/08 00:37:56 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.551 $ */
+/* NetHack 3.6 extern.h $NHDT-Date: 1457570257 2016/03/10 00:37:37 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.552 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
E char *FDECL(mshot_xname, (struct obj *));
E boolean FDECL(the_unique_obj, (struct obj *));
E boolean FDECL(the_unique_pm, (struct permonst *));
+E boolean FDECL(erosion_matters, (struct obj *));
E char *FDECL(doname, (struct obj *));
E char *FDECL(doname_with_price, (struct obj *));
E boolean FDECL(not_fully_identified, (struct obj *));
-/* NetHack 3.6 objnam.c $NHDT-Date: 1455672990 2016/02/17 01:36:30 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.165 $ */
+/* NetHack 3.6 objnam.c $NHDT-Date: 1457570258 2016/03/10 00:37:38 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.166 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
: "");
}
+/* used to prevent rust on items where rust makes no difference */
+boolean
+erosion_matters(obj)
+struct obj *obj;
+{
+ switch (obj->oclass) {
+ case TOOL_CLASS:
+ /* it's possible for a rusty weptool to be polymorphed into some
+ non-weptool iron tool, in which case the rust implicitly goes
+ away, but it's also possible for it to be polymorphed into a
+ non-iron tool, in which case rust also implicitly goes away,
+ so there's no particular reason to try to handle the first
+ instance differently [this comment belongs in poly_obj()...] */
+ return is_weptool(obj) ? TRUE : FALSE;
+ case WEAPON_CLASS:
+ case ARMOR_CLASS:
+ case BALL_CLASS:
+ case CHAIN_CLASS:
+ return TRUE;
+ default:
+ break;
+ }
+ return FALSE;
+}
+
static char *
doname_base(obj, with_price)
register struct obj *obj;
plur(itemcount));
}
- switch (obj->oclass) {
+ switch (is_weptool(obj) ? WEAPON_CLASS : obj->oclass) {
case AMULET_CLASS:
if (obj->owornmask & W_AMUL)
Strcat(bp, " (being worn)");
break;
+ case ARMOR_CLASS:
+ if (obj->owornmask & W_ARMOR)
+ Strcat(bp, (obj == uskin) ? " (embedded in your skin)"
+ : " (being worn)");
+ /*FALLTHRU*/
case WEAPON_CLASS:
if (ispoisoned)
Strcat(prefix, "poisoned ");
- plus:
add_erosion_words(obj, prefix);
if (known) {
Strcat(prefix, sitoa(obj->spe));
Strcat(prefix, " ");
}
break;
- case ARMOR_CLASS:
- if (obj->owornmask & W_ARMOR)
- Strcat(bp, (obj == uskin) ? " (embedded in your skin)"
- : " (being worn)");
- goto plus;
case TOOL_CLASS:
- /* weptools already get this done when we go to the +n code */
- if (!is_weptool(obj))
- add_erosion_words(obj, prefix);
- if (obj->owornmask & (W_TOOL /* blindfold */ | W_SADDLE)) {
+ if (obj->owornmask & (W_TOOL | W_SADDLE)) { /* blindfold */
Strcat(bp, " (being worn)");
break;
}
Strcat(bp, " (in use)");
break;
}
- if (is_weptool(obj))
- goto plus;
if (obj->otyp == CANDELABRUM_OF_INVOCATION) {
if (!obj->spe)
Strcpy(tmpbuf, "no");
goto charges;
break;
case WAND_CLASS:
- add_erosion_words(obj, prefix);
charges:
if (known)
Sprintf(eos(bp), " (%d:%d)", (int) obj->recharged, obj->spe);
Strcat(bp, " (lit)");
break;
case RING_CLASS:
- add_erosion_words(obj, prefix);
ring:
if (obj->owornmask & W_RINGR)
Strcat(bp, " (on right ");
curse(otmp);
}
- /* set eroded */
- if (is_damageable(otmp) || otmp->otyp == CRYSKNIFE) {
+ /* set eroded and erodeproof */
+ if (erosion_matters(otmp)) {
if (eroded && (is_flammable(otmp) || is_rustprone(otmp)))
otmp->oeroded = eroded;
if (eroded2 && (is_corrodeable(otmp) || is_rottable(otmp)))
otmp->oeroded2 = eroded2;
-
- /* set erodeproof */
- if (erodeproof && !eroded && !eroded2)
+ /*
+ * 3.6.1: earlier versions included `&& !eroded && !eroded2' here,
+ * but damageproof combined with damaged is feasible (eroded
+ * armor modified by confused reading of cursed destroy armor)
+ * so don't prevent player from wishing for such a combination.
+ */
+ if (erodeproof && (is_damageable(otmp) || otmp->otyp == CRYSKNIFE))
otmp->oerodeproof = (Luck >= 0 || wizard);
}
-/* NetHack 3.6 read.c $NHDT-Date: 1450577673 2015/12/20 02:14:33 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.131 $ */
+/* NetHack 3.6 read.c $NHDT-Date: 1457570260 2016/03/10 00:37:40 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.135 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
char *buf;
{
int erosion = greatest_erosion(otmp);
+
if (erosion)
wipeout_text(buf, (int) (strlen(buf) * erosion / (2 * MAX_ERODE)),
otmp->o_id ^ (unsigned) ubirthday);
*/
break;
case SCR_ENCHANT_WEAPON:
+ /* [What about twoweapon mode? Proofing/repairing/enchanting both
+ would be too powerful, but shouldn't we choose randomly between
+ primary and secondary instead of always acting on primary?] */
if (confused && uwep
- && (uwep->oclass == WEAPON_CLASS || is_weptool(uwep))) {
+ && erosion_matters(uwep) && uwep->oclass != ARMOR_CLASS) {
old_erodeproof = (uwep->oerodeproof != 0);
new_erodeproof = !scursed;
uwep->oerodeproof = 0; /* for messages */
-/* NetHack 3.6 trap.c $NHDT-Date: 1454528963 2016/02/03 19:49:23 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.261 $ */
+/* NetHack 3.6 trap.c $NHDT-Date: 1457570259 2016/03/10 00:37:39 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.262 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
if (check_grease && otmp->greased) {
grease_protect(otmp, ostr, victim);
return ER_GREASED;
+ } else if (!erosion_matters(otmp)) {
+ return ER_NOTHING;
} else if (!vulnerable || (otmp->oerodeproof && otmp->rknown)) {
if (flags.verbose && print && (uvictim || vismon))
pline("%s %s %s not affected by %s.",
-/* NetHack 3.6 zap.c $NHDT-Date: 1457482920 2016/03/09 00:22:00 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.248 $ */
+/* NetHack 3.6 zap.c $NHDT-Date: 1457570259 2016/03/10 00:37:39 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.249 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
otmp->cursed = obj->cursed;
otmp->blessed = obj->blessed;
- otmp->oeroded = obj->oeroded;
- otmp->oeroded2 = obj->oeroded2;
- if (!is_flammable(otmp) && !is_rustprone(otmp))
- otmp->oeroded = 0;
- if (!is_corrodeable(otmp) && !is_rottable(otmp))
- otmp->oeroded2 = 0;
- if (is_damageable(otmp))
- otmp->oerodeproof = obj->oerodeproof;
+
+ if (erosion_matters(otmp)) {
+ if (is_flammable(otmp) || is_rustprone(otmp))
+ otmp->oeroded = obj->oeroded;
+ if (is_corrodeable(otmp) || is_rottable(otmp))
+ otmp->oeroded2 = obj->oeroded2;
+ if (is_damageable(otmp))
+ otmp->oerodeproof = obj->oerodeproof;
+ }
/* Keep chest/box traps and poisoned ammo if we may */
if (obj->otrapped && Is_box(otmp))