#define COST_DRAIN 1 /* drain life upon an object */
#define COST_UNCHRG 2 /* cursed charging */
#define COST_UNBLSS 3 /* unbless (devalues holy water) */
-#define COST_UNHOLY 4 /* uncurse (devalues unholy water) */
+#define COST_UNCURS 4 /* uncurse (devalues unholy water) */
#define COST_DECHNT 5 /* disenchant weapons or armor */
#define COST_DEGRD 6 /* removal of rustproofing, dulling via engraving */
#define COST_DILUTE 7 /* potion dilution */
{
xchar ox, oy;
char objroom;
+ boolean set_bknown;
const char *those, *them, *what;
struct monst *shkp = 0;
else
those = "those", them = "them";
+ /* when shopkeeper describes the object as being uncursed or unblessed
+ hero will know that it is now uncursed; will also make the feedback
+ from `I x' after bill_dummy_object() be more specific for this item */
+ set_bknown = (alter_type == COST_UNCURS || alter_type == COST_UNBLSS);
+
switch (obj->where) {
case OBJ_FREE: /* obj_no_longer_held() */
case OBJ_INVENT:
+ if (set_bknown) obj->bknown = 1;
what = simple_typename(obj->otyp);
if (obj->quan != 1L) what = makeplural(what);
verbalize("You %s %s %s, you pay for %s!",
bill_dummy_object(obj);
break;
case OBJ_FLOOR:
+ if (set_bknown) obj->bknown = 1;
if (costly_spot(u.ux, u.uy) && objroom == *u.ushops) {
verbalize("You %s %s, you pay for %s!",
alteration_verbs[alter_type], those, them);
hcolor(NH_AMBER));
obj->bknown = 1;
if (obj->otyp == POT_WATER && obj->unpaid)
- costly_alteration(obj, COST_UNHOLY);
+ costly_alteration(obj, COST_UNCURS);
uncurse(obj);
poof:
if(!(objects[potion->otyp].oc_name_known) &&
if (sobj->blessed || wornmask ||
obj->otyp == LOADSTONE ||
(obj->otyp == LEASH && obj->leashmon)) {
- unsigned save_bknown, save_cursed, save_blessed;
- boolean was_cursed = !!obj->cursed,
- was_blessed = !!obj->blessed,
- was_normal = !(was_cursed || was_blessed);
-
- if(confused) blessorcurse(obj, 2);
- else uncurse(obj);
/* water price varies by curse/bless status */
- if (obj->unpaid && obj->otyp == POT_WATER) {
- if ((was_cursed && !obj->cursed) ||
- (was_blessed && !obj->blessed)) {
- /* make `Ix' more specific for this item */
- save_bknown = obj->bknown;
- obj->bknown = 1;
- /* temporarily restore curse/bless to
- obtain the right shop price (if potion
- went from cursed directly to blessed
- or vice versa its price didn't change
- but hero will have to buy it anyway) */
- save_cursed = obj->cursed;
- obj->cursed = was_cursed ? 1 : 0;
- save_blessed = obj->blessed;
- obj->blessed = was_blessed ? 1 : 0;
- costly_alteration(obj, was_cursed ?
- COST_UNHOLY : COST_UNBLSS);
- obj->bknown = save_bknown;
- obj->cursed = save_cursed;
- obj->blessed = save_blessed;
- } else if (was_normal &&
- (obj->blessed || obj->cursed)) {
- alter_cost(obj, 0L);
- }
- } /* unpaid water */
+ boolean shop_h2o = (obj->unpaid &&
+ obj->otyp == POT_WATER);
+
+ if (confused) {
+ blessorcurse(obj, 2);
+ /* blessorcurse() only affects uncursed items
+ so no need to worry about price of water
+ going down (hence no costly_alteration) */
+ if (shop_h2o && (obj->cursed || obj->blessed))
+ alter_cost(obj, 0L); /* price goes up */
+ } else if (obj->cursed) {
+ if (shop_h2o)
+ costly_alteration(obj, COST_UNCURS);
+ uncurse(obj);
+ }
}
}
}
(obj->spe && (obj->oclass == ARMOR_CLASS ||
obj->oclass == WEAPON_CLASS || is_weptool(obj))) ||
otyp == POT_ACID || otyp == POT_SICKNESS ||
- (otyp == WATER && (obj->blessed || obj->cursed))) {
+ (otyp == POT_WATER && (obj->blessed || obj->cursed))) {
if (obj->spe != ((obj->oclass == WAND_CLASS) ? -1 : 0) &&
otyp != WAN_CANCELLATION && /* can't cancel cancellation */
otyp != MAGIC_LAMP && /* cancelling doesn't remove djini */
}
break;
case POTION_CLASS:
- costly_alteration(obj, (otyp == WATER && obj->cursed) ?
- COST_UNHOLY : COST_CANCEL);
+ costly_alteration(obj, (otyp != POT_WATER) ? COST_CANCEL :
+ obj->cursed ? COST_UNCURS : COST_UNBLSS);
if (otyp == POT_SICKNESS || otyp == POT_SEE_INVISIBLE) {
/* sickness is "biologically contaminated" fruit juice;
cancel it and it just becomes fruit juice...