]> granicus.if.org Git - nethack/commitdiff
remove curse tweak
authornethack.rankin <nethack.rankin>
Thu, 7 Nov 2002 03:55:51 +0000 (03:55 +0000)
committernethack.rankin <nethack.rankin>
Thu, 7 Nov 2002 03:55:51 +0000 (03:55 +0000)
     When reading an uncursed scroll of remove curse, don't uncurse
an item "worn" in the quiver slot unless it is actually ammo or other
missile weapon.

doc/fixes34.1
src/read.c

index 92778379c4ff3228c731f6f9e03c130c95d65c98..43dc66b138e87fb8a8bdd3b9c907d30a647e6424 100644 (file)
@@ -297,6 +297,8 @@ becoming confused, eg from nausia, while reading a spellbook should result
 level teleports should not be controlled if you're confused
 vault wall repair should remove traps subsequently created at affected spots
 don't reveal deity name when a high priest(ess) gives temple entry greeting
+for ordinary remove curse, don't uncurse quivered object unless it is suitable
+       to be used as a quivered weapon (ammo or missile)
 
 
 Platform- and/or Interface-Specific Fixes
index 67954ad878373cdc03e1af76c3ab023cf85e8675..ba8c4f496035a5f0b24855961eab85ad446b748c 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)read.c     3.4     2002/10/04      */
+/*     SCCS Id: @(#)read.c     3.4     2002/11/06      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -911,15 +911,43 @@ register struct obj       *sobj;
                if (sobj->cursed) {
                    pline_The("scroll disintegrates.");
                } else {
-                   for (obj = invent; obj; obj = obj->nobj)
-                       if (sobj->blessed ||
-                            (obj->owornmask &&
-                              ((obj->owornmask & ~W_SWAPWEP) || u.twoweap)) ||
+                   for (obj = invent; obj; obj = obj->nobj) {
+                       long wornmask;
+#ifdef GOLDOBJ
+                       /* gold isn't subject to cursing and blessing */
+                       if (obj->oclass == COIN_CLASS) continue;
+#endif
+                       wornmask = (obj->owornmask & ~(W_BALL|W_ART|W_ARTI));
+                       if (wornmask && !sobj->blessed) {
+                           /* handle a couple of special cases; we don't
+                              allow auxiliary weapon slots to be used to
+                              artificially increase number of worn items */
+                           if (obj == uswapwep) {
+                               if (!u.twoweap) wornmask = 0L;
+                           } else if (obj == uquiver) {
+                               if (obj->oclass == WEAPON_CLASS) {
+                                   /* mergeable weapon test covers ammo,
+                                      missiles, spears, daggers & knives */
+                                   if (!objects[obj->otyp].oc_merge) 
+                                       wornmask = 0L;
+                               } else if (obj->oclass == GEM_CLASS) {
+                                   /* possibly ought to check whether
+                                      alternate weapon is a sling... */
+                                   if (!uslinging()) wornmask = 0L;
+                               } else {
+                                   /* weptools don't merge and aren't
+                                      reasonable quivered weapons */
+                                   wornmask = 0L;
+                               }
+                           }
+                       }
+                       if (sobj->blessed || wornmask ||
                             obj->otyp == LOADSTONE ||
                             (obj->otyp == LEASH && obj->leashmon)) {
                            if(confused) blessorcurse(obj, 2);
                            else uncurse(obj);
                        }
+                   }
                }
                if(Punished && !confused) unpunish();
                update_inventory();