costly_alteration() tweaking (trunk only)
For cancellation I accidentally used terrain type WATER when I meant
object type POT_WATER, so being charged for cancelling holy or unholy water
wasn't working. When I first put in COST_UNHOLY the name made some sense
based on its usage, but after later adding COST_UNBLSS it didn't any more;
change it to COST_UNCURS.
A shopkeeper's complaint that you're uncursing or unblessing his wares
(only applies to water) now sets bknown flag since you know that the object
has become uncursed. I hadn't realized that confused remove curse only
affects uncursed objects; this greatly simplifies extra code I added there
for costly_alteration().
[No fixes entry needed.]
This commit is contained in:
+1
-1
@@ -64,7 +64,7 @@
|
|||||||
#define COST_DRAIN 1 /* drain life upon an object */
|
#define COST_DRAIN 1 /* drain life upon an object */
|
||||||
#define COST_UNCHRG 2 /* cursed charging */
|
#define COST_UNCHRG 2 /* cursed charging */
|
||||||
#define COST_UNBLSS 3 /* unbless (devalues holy water) */
|
#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_DECHNT 5 /* disenchant weapons or armor */
|
||||||
#define COST_DEGRD 6 /* removal of rustproofing, dulling via engraving */
|
#define COST_DEGRD 6 /* removal of rustproofing, dulling via engraving */
|
||||||
#define COST_DILUTE 7 /* potion dilution */
|
#define COST_DILUTE 7 /* potion dilution */
|
||||||
|
|||||||
@@ -369,6 +369,7 @@ int alter_type;
|
|||||||
{
|
{
|
||||||
xchar ox, oy;
|
xchar ox, oy;
|
||||||
char objroom;
|
char objroom;
|
||||||
|
boolean set_bknown;
|
||||||
const char *those, *them, *what;
|
const char *those, *them, *what;
|
||||||
struct monst *shkp = 0;
|
struct monst *shkp = 0;
|
||||||
|
|
||||||
@@ -401,9 +402,15 @@ int alter_type;
|
|||||||
else
|
else
|
||||||
those = "those", them = "them";
|
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) {
|
switch (obj->where) {
|
||||||
case OBJ_FREE: /* obj_no_longer_held() */
|
case OBJ_FREE: /* obj_no_longer_held() */
|
||||||
case OBJ_INVENT:
|
case OBJ_INVENT:
|
||||||
|
if (set_bknown) obj->bknown = 1;
|
||||||
what = simple_typename(obj->otyp);
|
what = simple_typename(obj->otyp);
|
||||||
if (obj->quan != 1L) what = makeplural(what);
|
if (obj->quan != 1L) what = makeplural(what);
|
||||||
verbalize("You %s %s %s, you pay for %s!",
|
verbalize("You %s %s %s, you pay for %s!",
|
||||||
@@ -411,6 +418,7 @@ int alter_type;
|
|||||||
bill_dummy_object(obj);
|
bill_dummy_object(obj);
|
||||||
break;
|
break;
|
||||||
case OBJ_FLOOR:
|
case OBJ_FLOOR:
|
||||||
|
if (set_bknown) obj->bknown = 1;
|
||||||
if (costly_spot(u.ux, u.uy) && objroom == *u.ushops) {
|
if (costly_spot(u.ux, u.uy) && objroom == *u.ushops) {
|
||||||
verbalize("You %s %s, you pay for %s!",
|
verbalize("You %s %s, you pay for %s!",
|
||||||
alteration_verbs[alter_type], those, them);
|
alteration_verbs[alter_type], those, them);
|
||||||
|
|||||||
+1
-1
@@ -1693,7 +1693,7 @@ dodip()
|
|||||||
hcolor(NH_AMBER));
|
hcolor(NH_AMBER));
|
||||||
obj->bknown = 1;
|
obj->bknown = 1;
|
||||||
if (obj->otyp == POT_WATER && obj->unpaid)
|
if (obj->otyp == POT_WATER && obj->unpaid)
|
||||||
costly_alteration(obj, COST_UNHOLY);
|
costly_alteration(obj, COST_UNCURS);
|
||||||
uncurse(obj);
|
uncurse(obj);
|
||||||
poof:
|
poof:
|
||||||
if(!(objects[potion->otyp].oc_name_known) &&
|
if(!(objects[potion->otyp].oc_name_known) &&
|
||||||
|
|||||||
+15
-32
@@ -964,39 +964,22 @@ struct obj *sobj;
|
|||||||
if (sobj->blessed || wornmask ||
|
if (sobj->blessed || wornmask ||
|
||||||
obj->otyp == LOADSTONE ||
|
obj->otyp == LOADSTONE ||
|
||||||
(obj->otyp == LEASH && obj->leashmon)) {
|
(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 */
|
/* water price varies by curse/bless status */
|
||||||
if (obj->unpaid && obj->otyp == POT_WATER) {
|
boolean shop_h2o = (obj->unpaid &&
|
||||||
if ((was_cursed && !obj->cursed) ||
|
obj->otyp == POT_WATER);
|
||||||
(was_blessed && !obj->blessed)) {
|
|
||||||
/* make `Ix' more specific for this item */
|
if (confused) {
|
||||||
save_bknown = obj->bknown;
|
blessorcurse(obj, 2);
|
||||||
obj->bknown = 1;
|
/* blessorcurse() only affects uncursed items
|
||||||
/* temporarily restore curse/bless to
|
so no need to worry about price of water
|
||||||
obtain the right shop price (if potion
|
going down (hence no costly_alteration) */
|
||||||
went from cursed directly to blessed
|
if (shop_h2o && (obj->cursed || obj->blessed))
|
||||||
or vice versa its price didn't change
|
alter_cost(obj, 0L); /* price goes up */
|
||||||
but hero will have to buy it anyway) */
|
} else if (obj->cursed) {
|
||||||
save_cursed = obj->cursed;
|
if (shop_h2o)
|
||||||
obj->cursed = was_cursed ? 1 : 0;
|
costly_alteration(obj, COST_UNCURS);
|
||||||
save_blessed = obj->blessed;
|
uncurse(obj);
|
||||||
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 */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -855,7 +855,7 @@ register struct obj *obj;
|
|||||||
(obj->spe && (obj->oclass == ARMOR_CLASS ||
|
(obj->spe && (obj->oclass == ARMOR_CLASS ||
|
||||||
obj->oclass == WEAPON_CLASS || is_weptool(obj))) ||
|
obj->oclass == WEAPON_CLASS || is_weptool(obj))) ||
|
||||||
otyp == POT_ACID || otyp == POT_SICKNESS ||
|
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) &&
|
if (obj->spe != ((obj->oclass == WAND_CLASS) ? -1 : 0) &&
|
||||||
otyp != WAN_CANCELLATION && /* can't cancel cancellation */
|
otyp != WAN_CANCELLATION && /* can't cancel cancellation */
|
||||||
otyp != MAGIC_LAMP && /* cancelling doesn't remove djini */
|
otyp != MAGIC_LAMP && /* cancelling doesn't remove djini */
|
||||||
@@ -876,8 +876,8 @@ register struct obj *obj;
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case POTION_CLASS:
|
case POTION_CLASS:
|
||||||
costly_alteration(obj, (otyp == WATER && obj->cursed) ?
|
costly_alteration(obj, (otyp != POT_WATER) ? COST_CANCEL :
|
||||||
COST_UNHOLY : COST_CANCEL);
|
obj->cursed ? COST_UNCURS : COST_UNBLSS);
|
||||||
if (otyp == POT_SICKNESS || otyp == POT_SEE_INVISIBLE) {
|
if (otyp == POT_SICKNESS || otyp == POT_SEE_INVISIBLE) {
|
||||||
/* sickness is "biologically contaminated" fruit juice;
|
/* sickness is "biologically contaminated" fruit juice;
|
||||||
cancel it and it just becomes fruit juice...
|
cancel it and it just becomes fruit juice...
|
||||||
|
|||||||
Reference in New Issue
Block a user