avoid "you finish disrobing" when disarming via the 'A' command
make sure corpses and statues which remember monster attributes don't keep
ones that were conferred by no longer worn items (mainly speed boots)
+elevate the trouble priority of any cursed item which is preventing removal
+ of a ring of levitation
Platform- and/or Interface-Specific Fixes
E void NDECL(glibr);
E struct obj *FDECL(some_armor,(struct monst *));
E void FDECL(erode_armor, (struct monst *,BOOLEAN_P));
+E struct obj *FDECL(stuck_ring, (struct obj *,int));
E void NDECL(reset_remarm);
E int NDECL(doddoremarm);
E int FDECL(destroy_arm, (struct obj *));
}
}
+/* used for praying to check and fix levitation trouble */
+struct obj *
+stuck_ring(ring, otyp)
+struct obj *ring;
+int otyp;
+{
+ if (ring != uleft && ring != uright) {
+ impossible("stuck_ring: neither left nor right?");
+ return (struct obj *)0;
+ }
+
+ if (ring && ring->otyp == otyp) {
+ /* reasons ring can't be removed match those checked by select_off();
+ limbless case has extra checks because ordinarily it's temporary */
+ if (nolimbs(youmonst.data) &&
+ uamul && uamul->otyp == AMULET_OF_UNCHANGING && uamul->cursed)
+ return uamul;
+ if (welded(uwep) && (ring == uright || bimanual(uwep))) return uwep;
+ if (uarmg && uarmg->cursed) return uarmg;
+ if (ring->cursed) return ring;
+ }
+ /* either no ring or not right type or nothing prevents its removal */
+ return (struct obj *)0;
+}
+
STATIC_PTR
int
select_off(otmp)
-/* SCCS Id: @(#)pray.c 3.4 2002/03/02 */
+/* SCCS Id: @(#)pray.c 3.4 2002/09/09 */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
return(TROUBLE_STUCK_IN_WALL);
if((uarmf && uarmf->otyp==LEVITATION_BOOTS && uarmf->cursed) ||
- (uleft && uleft->otyp==RIN_LEVITATION && uleft->cursed) ||
- (uright && uright->otyp==RIN_LEVITATION && uright->cursed))
+ stuck_ring(uleft, RIN_LEVITATION) ||
+ stuck_ring(uright, RIN_LEVITATION))
return(TROUBLE_CURSED_LEVITATION);
if(Blindfolded && ublindf->cursed) return(TROUBLE_CURSED_BLINDFOLD);
register int trouble;
{
int i;
- struct obj *otmp;
+ struct obj *otmp = 0;
const char *what = (const char *)0;
switch (trouble) {
(void) safe_teleds(FALSE);
break;
case TROUBLE_CURSED_LEVITATION:
- if (uarmf && uarmf->otyp==LEVITATION_BOOTS
- && uarmf->cursed)
+ if (uarmf && uarmf->otyp == LEVITATION_BOOTS &&
+ uarmf->cursed) {
otmp = uarmf;
- else if (uleft && uleft->otyp==RIN_LEVITATION
- && uleft->cursed) {
- otmp = uleft;
- what = leftglow;
- } else {
- otmp = uright;
- what = rightglow;
+ } else if ((otmp = stuck_ring(uleft,RIN_LEVITATION)) !=0) {
+ if (otmp == uleft) what = leftglow;
+ } else if ((otmp = stuck_ring(uright,RIN_LEVITATION))!=0) {
+ if (otmp == uright) what = rightglow;
}
goto decurse;
case TROUBLE_CURSED_BLINDFOLD: