fix #H4475 - shop message about disenchanted item

drain_item() always assumed player was responsible, so called
costly_alteration() to adjust shop price of disenchanted item.
If it was unpaid and the effect was caused by a disenchanter
attack rather than by the hero, the feedback was nonsensical.

This also lets a disenchanter hit worn rings, amulet, or blindfold
if no armor gets targetted.  Amulets, blindfolds, and most rings
have no charge to be drained, but several types of rings do.
This commit is contained in:
PatR
2016-08-10 02:04:09 -07:00
parent 62fd796271
commit a72d19b905
6 changed files with 50 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 extern.h $NHDT-Date: 1461967848 2016/04/29 22:10:48 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.558 $ */
/* NetHack 3.6 extern.h $NHDT-Date: 1470819839 2016/08/10 09:03:59 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.569 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2771,7 +2771,7 @@ E struct monst *FDECL(montraits, (struct obj *, coord *));
E struct monst *FDECL(revive, (struct obj *, BOOLEAN_P));
E int FDECL(unturn_dead, (struct monst *));
E void FDECL(cancel_item, (struct obj *));
E boolean FDECL(drain_item, (struct obj *));
E boolean FDECL(drain_item, (struct obj *, BOOLEAN_P));
E struct obj *FDECL(poly_obj, (struct obj *, int));
E boolean FDECL(obj_resists, (struct obj *, int, int));
E boolean FDECL(obj_shudders, (struct obj *));