fix #H4057 - rusting amulets
There have been two or three reports on getting feedback about amulets rusting. Object formatting doesn't display erosion for them, so being told about damage then not seeing that damage feels like a bug. Even if damage was displayed, it has no effect on them so would still feel somewhat strange. It does display erosion for wands and rings, which is strange too. This limits erosion damage--and its feedback--to items which are actually impacted by erosion: armor, weapons and weapon-tools; also heavy iron balls and iron chains since they've traditionally shown rust even though it has little effect. A side-effect of this change is that flammable items (other than armor and weapons) which don't burn up immediately will no longer become burnt, then very burnt, thorougly burnt, and finally be destroyed. Since the player couldn't see or possibly repair the erosion state, it seemed incomplete. It could be reinstated by making other flammable items be subject to erosion and displayed as such by xname() & co. Wishing now avoids applying erosion and erosion-proofing to items that aren't affected by it, regardless of material. It also now allows wishing for "rusty rustproof <iron-object>" which used to suppress "rusty" in that combination and triggered a couple of old bug reports. Heavy iron balls and iron chains can have rust repaired and can be made rustproof by wielding, then reading enchant weapon while confused, as if they were weapons.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* 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. */
|
||||
|
||||
@@ -60,6 +60,7 @@ struct obj *otmp;
|
||||
char *buf;
|
||||
{
|
||||
int erosion = greatest_erosion(otmp);
|
||||
|
||||
if (erosion)
|
||||
wipeout_text(buf, (int) (strlen(buf) * erosion / (2 * MAX_ERODE)),
|
||||
otmp->o_id ^ (unsigned) ubirthday);
|
||||
@@ -1312,8 +1313,11 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
|
||||
*/
|
||||
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 */
|
||||
|
||||
Reference in New Issue
Block a user