blindfolds and more (trunk only)
1) the change yesterday to mark inventory as seen when recovering from blindness neglected to handle blindfold removal; 2) fix grammar when using 'R' or 'a' to try to remove cursed lenses (now "they are cursed" instead of "it is cursed"); 3) attempting to put on a wielded or quivered blindfold, amulet, or ring and failing because of already wearing one (or two in the case of rings, where cursed gloves and ESC at "which ring-finger?" prompt got similar result) unwielded/unquivered item rather than leave it as is.
This commit is contained in:
+39
-32
@@ -80,6 +80,7 @@ struct obj *otmp;
|
|||||||
/*
|
/*
|
||||||
* The Type_on() functions should be called *after* setworn().
|
* The Type_on() functions should be called *after* setworn().
|
||||||
* The Type_off() functions call setworn() themselves.
|
* The Type_off() functions call setworn() themselves.
|
||||||
|
* [Blindf_on() is an exception and calls setworn() itself.]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
STATIC_PTR
|
STATIC_PTR
|
||||||
@@ -590,6 +591,12 @@ Armor_gone()
|
|||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
Amulet_on()
|
Amulet_on()
|
||||||
{
|
{
|
||||||
|
/* make sure amulet isn't wielded; can't use remove_worn_item()
|
||||||
|
here because it has already been set worn in amulet slot */
|
||||||
|
if (uamul == uwep) setuwep((struct obj *)0);
|
||||||
|
else if (uamul == uswapwep) setuswapwep((struct obj *)0);
|
||||||
|
else if (uamul == uquiver) setuqwep((struct obj *)0);
|
||||||
|
|
||||||
switch(uamul->otyp) {
|
switch(uamul->otyp) {
|
||||||
case AMULET_OF_ESP:
|
case AMULET_OF_ESP:
|
||||||
case AMULET_OF_LIFE_SAVING:
|
case AMULET_OF_LIFE_SAVING:
|
||||||
@@ -699,9 +706,11 @@ register struct obj *obj;
|
|||||||
long oldprop = u.uprops[objects[obj->otyp].oc_oprop].extrinsic;
|
long oldprop = u.uprops[objects[obj->otyp].oc_oprop].extrinsic;
|
||||||
int old_attrib, which;
|
int old_attrib, which;
|
||||||
|
|
||||||
if (obj == uwep) setuwep((struct obj *) 0);
|
/* make sure ring isn't wielded; can't use remove_worn_item()
|
||||||
if (obj == uswapwep) setuswapwep((struct obj *) 0);
|
here because it has already been set worn in a ring slot */
|
||||||
if (obj == uquiver) setuqwep((struct obj *) 0);
|
if (obj == uwep) setuwep((struct obj *)0);
|
||||||
|
else if (obj == uswapwep) setuswapwep((struct obj *)0);
|
||||||
|
else if (obj == uquiver) setuqwep((struct obj *)0);
|
||||||
|
|
||||||
/* only mask out W_RING when we don't have both
|
/* only mask out W_RING when we don't have both
|
||||||
left and right rings of the same type */
|
left and right rings of the same type */
|
||||||
@@ -925,12 +934,9 @@ register struct obj *otmp;
|
|||||||
{
|
{
|
||||||
boolean already_blind = Blind, changed = FALSE;
|
boolean already_blind = Blind, changed = FALSE;
|
||||||
|
|
||||||
if (otmp == uwep)
|
/* blindfold might be wielded; release it for wearing */
|
||||||
setuwep((struct obj *) 0);
|
if (otmp->owornmask & (W_WEP|W_SWAPWEP|W_QUIVER))
|
||||||
if (otmp == uswapwep)
|
remove_worn_item(otmp, FALSE);
|
||||||
setuswapwep((struct obj *) 0);
|
|
||||||
if (otmp == uquiver)
|
|
||||||
setuqwep((struct obj *) 0);
|
|
||||||
setworn(otmp, W_TOOL);
|
setworn(otmp, W_TOOL);
|
||||||
on_msg(otmp);
|
on_msg(otmp);
|
||||||
|
|
||||||
@@ -948,6 +954,7 @@ register struct obj *otmp;
|
|||||||
/* blindness has just been toggled */
|
/* blindness has just been toggled */
|
||||||
if (Blind_telepat || Infravision) see_monsters();
|
if (Blind_telepat || Infravision) see_monsters();
|
||||||
vision_full_recalc = 1; /* recalc vision limits */
|
vision_full_recalc = 1; /* recalc vision limits */
|
||||||
|
if (!Blind) learn_unseen_invent();
|
||||||
context.botl = 1;
|
context.botl = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -985,6 +992,7 @@ register struct obj *otmp;
|
|||||||
/* blindness has just been toggled */
|
/* blindness has just been toggled */
|
||||||
if (Blind_telepat || Infravision) see_monsters();
|
if (Blind_telepat || Infravision) see_monsters();
|
||||||
vision_full_recalc = 1; /* recalc vision limits */
|
vision_full_recalc = 1; /* recalc vision limits */
|
||||||
|
if (!Blind) learn_unseen_invent();
|
||||||
context.botl = 1;
|
context.botl = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1206,9 +1214,10 @@ register struct obj *otmp;
|
|||||||
{
|
{
|
||||||
/* Curses, like chickens, come home to roost. */
|
/* Curses, like chickens, come home to roost. */
|
||||||
if((otmp == uwep) ? welded(otmp) : (int)otmp->cursed) {
|
if((otmp == uwep) ? welded(otmp) : (int)otmp->cursed) {
|
||||||
You("can't. %s cursed.",
|
boolean use_plural = (is_boots(otmp) || is_gloves(otmp) ||
|
||||||
(is_boots(otmp) || is_gloves(otmp) || otmp->quan > 1L)
|
otmp->otyp == LENSES || otmp->quan > 1L);
|
||||||
? "They are" : "It is");
|
|
||||||
|
You("can't. %s cursed.", use_plural ? "They are" : "It is");
|
||||||
otmp->bknown = TRUE;
|
otmp->bknown = TRUE;
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
@@ -1256,8 +1265,10 @@ register struct obj *otmp;
|
|||||||
* off_msg before removal anyway so there's no problem. Take
|
* off_msg before removal anyway so there's no problem. Take
|
||||||
* care in adding armors granting fire resistance; this code
|
* care in adding armors granting fire resistance; this code
|
||||||
* might need modification.
|
* might need modification.
|
||||||
* 3.2 (actually 3.1 even): this comment is obsolete since
|
* 3.2 (actually 3.1 even): that comment is obsolete since
|
||||||
* fire resistance is not needed for Gehennom.
|
* fire resistance is not required for Gehennom so setworn()
|
||||||
|
* doesn't force the resistance granting item to be re-worn
|
||||||
|
* after being lifesaved anymore.
|
||||||
*/
|
*/
|
||||||
if(is_cloak(otmp))
|
if(is_cloak(otmp))
|
||||||
(void) Cloak_off();
|
(void) Cloak_off();
|
||||||
@@ -1480,13 +1491,10 @@ dowear()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
otmp->known = TRUE;
|
otmp->known = 1; /* since AC is shown on the status line */
|
||||||
if(otmp == uwep)
|
/* if the armor is wielded, release it for wearing */
|
||||||
setuwep((struct obj *)0);
|
if (otmp->owornmask & (W_WEP|W_SWAPWEP|W_QUIVER))
|
||||||
if (otmp == uswapwep)
|
remove_worn_item(otmp, FALSE);
|
||||||
setuswapwep((struct obj *) 0);
|
|
||||||
if (otmp == uquiver)
|
|
||||||
setuqwep((struct obj *) 0);
|
|
||||||
setworn(otmp, mask);
|
setworn(otmp, mask);
|
||||||
delay = -objects[otmp->otyp].oc_delay;
|
delay = -objects[otmp->otyp].oc_delay;
|
||||||
if(delay){
|
if(delay){
|
||||||
@@ -1531,12 +1539,14 @@ doputon()
|
|||||||
weldmsg(otmp);
|
weldmsg(otmp);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
if(otmp == uwep)
|
#if 0
|
||||||
setuwep((struct obj *)0);
|
/* defer til Xxx_on(); various failures below now leave item wielded
|
||||||
if(otmp == uswapwep)
|
*/
|
||||||
setuswapwep((struct obj *) 0);
|
/* accessory might be wielded; release it for wearing */
|
||||||
if(otmp == uquiver)
|
if (otmp->owornmask & (W_WEP|W_SWAPWEP|W_QUIVER))
|
||||||
setuqwep((struct obj *) 0);
|
remove_worn_item(otmp, FALSE);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(otmp->oclass == RING_CLASS || otmp->otyp == MEAT_RING) {
|
if(otmp->oclass == RING_CLASS || otmp->otyp == MEAT_RING) {
|
||||||
if(nolimbs(youmonst.data)) {
|
if(nolimbs(youmonst.data)) {
|
||||||
You("cannot make the ring stick to your body.");
|
You("cannot make the ring stick to your body.");
|
||||||
@@ -1597,12 +1607,9 @@ doputon()
|
|||||||
if (!retouch_object(&otmp, FALSE))
|
if (!retouch_object(&otmp, FALSE))
|
||||||
return 1;
|
return 1;
|
||||||
setworn(otmp, W_AMUL);
|
setworn(otmp, W_AMUL);
|
||||||
if (otmp->otyp == AMULET_OF_CHANGE) {
|
|
||||||
Amulet_on();
|
|
||||||
/* Don't do a prinv() since the amulet is now gone */
|
|
||||||
return(1);
|
|
||||||
}
|
|
||||||
Amulet_on();
|
Amulet_on();
|
||||||
|
/* finished now if an amulet of change got used up */
|
||||||
|
if (!uamul) return 1;
|
||||||
} else { /* it's a blindfold, towel, or lenses */
|
} else { /* it's a blindfold, towel, or lenses */
|
||||||
if (ublindf) {
|
if (ublindf) {
|
||||||
if (ublindf->otyp == TOWEL)
|
if (ublindf->otyp == TOWEL)
|
||||||
|
|||||||
Reference in New Issue
Block a user