]> granicus.if.org Git - nethack/commitdiff
dragon scale mail degraded by polymorphing into dragon (trunk only)
authornethack.rankin <nethack.rankin>
Tue, 1 Mar 2011 12:15:51 +0000 (12:15 +0000)
committernethack.rankin <nethack.rankin>
Tue, 1 Mar 2011 12:15:51 +0000 (12:15 +0000)
     Apparently I lied yesterday when I said that patch was the last
polyself one.  This has been on my agenda for a long time:  when dragon
scale mail merges with your skin during polymorph into the corresponding
dragon, have it revert from mail to scales.  Its enchantment stays the
same when reverting.  So after returning to your original form, using
enchant armor to convert it into scale mail again will eventually risk
its destruction due to over-enchanting.  (Cursed scroll of enchant armor,
spell of drain life, or being hit by a disenchanter can be used to reduce
its enchantment back to a safe-to-enchnat value.  Or cancellation if
you're desperate.  I think those all work on all colors of dragon scales
despite the assorted magical properties that scales confer.)

doc/fixes35.0
src/polyself.c
src/read.c

index be0dd0521fb63ac0d3587b1754ba78b36edbe85e..8ca9c4fc4d2e6e01d02965ff18ddadbe6a49b119 100644 (file)
@@ -475,6 +475,8 @@ can now use ESC to cancel out of prompts for playing musical instruments
 being crowned gives an additional benefit:  one extra skill slot/credit
 chatting to a gecko or shopkeeper while hallucinating gives alternate message
 mimic posing as door might steal hero's key when [un]locking is attempted
+polymorphing into a dragon while wearing dragon scale mail will cause that
+       mail to revert to dragon scales
 
 
 Platform- and/or Interface-Specific New Features
index c7010ff4098eb25f208ab82468e3f969b9c4a1d2..5e96f01aa77392c131ddf344c64c74348ab03f0a 100644 (file)
@@ -388,11 +388,36 @@ int psflags;
                        mntmp = armor_to_dragon(uarm->otyp);
                        if (!(mvitals[mntmp].mvflags & G_GENOD)) {
                                /* allow G_EXTINCT */
-                               You("merge with your scaly armor.");
+                               if (Is_dragon_scales(uarm)) {
+                                   /* dragon scales remain intact as uskin */
+                                   You("merge with your scaly armor.");
+                               } else {        /* dragon scale mail */
+                                   /* d.scale mail first reverts to scales */
+                                   char *p, *dsmail;
+
+                                   /* similar to noarmor(invent.c),
+                                      shorten to "<color> scale mail" */
+                                   dsmail = strcpy(buf, simpleonames(uarm));
+                                   if ((p = strstri(dsmail, " dragon ")) != 0)
+                                       while ((p[1] = p[8]) != '\0') ++p;
+                                   /* tricky phrasing; dragon scale mail
+                                      is singular, dragon scales are plural */
+                                   Your(
+                               "%s reverts to scales as you merge with them.",
+                                        dsmail);
+                                   /* uarm->spe enchantment remains unchanged;
+                                      re-converting scales to mail poses risk
+                                      of evaporation due to over enchanting */
+                                   uarm->otyp += GRAY_DRAGON_SCALES
+                                                   - GRAY_DRAGON_SCALE_MAIL;
+                                   uarm->dknown = 1;
+                                   context.botl = 1;   /* AC is changing */
+                               }
                                uskin = uarm;
                                uarm = (struct obj *)0;
                                /* save/restore hack */
                                uskin->owornmask |= I_SPECIAL;
+                               update_inventory();
                        }
                } else if (iswere) {
  do_shift:
index eedcc6908b8b5f6f4d2cbe7b3c510841c97f06f3..b139e82660a07bfa83bf57e433fc7c2e5aa3150b 100644 (file)
@@ -810,29 +810,20 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
                              (Blind || same_color) ? nul :
                                hcolor(scursed ? NH_BLACK : NH_SILVER),
                              otense(otmp, "evaporate"));
-                       if(is_cloak(otmp)) (void) Cloak_off();
-                       if(is_boots(otmp)) (void) Boots_off();
-                       if(is_helmet(otmp)) (void) Helmet_off();
-                       if(is_gloves(otmp)) (void) Gloves_off();
-                       if(is_shield(otmp)) (void) Shield_off();
-                       if(otmp == uarm) (void) Armor_gone();
-#ifdef TOURIST
-                       if (is_shirt(otmp)) (void) Shirt_off();
-#endif
+                       remove_worn_item(otmp, FALSE);
                        useup(otmp);
                        break;
                }
                s = scursed ? -1 :
                    otmp->spe >= 9 ? (rn2(otmp->spe) == 0) :
                    sblessed ? rnd(3 - otmp->spe / 3) : 1;
-               if (s >= 0 && otmp->otyp >= GRAY_DRAGON_SCALES &&
-                                       otmp->otyp <= YELLOW_DRAGON_SCALES) {
+               if (s >= 0 && Is_dragon_scales(otmp)) {
                        /* dragon scales get turned into dragon scale mail */
                        pline("%s merges and hardens!", Yname2(otmp));
                        setworn((struct obj *)0, W_ARM);
                        /* assumes same order */
-                       otmp->otyp = GRAY_DRAGON_SCALE_MAIL +
-                                               otmp->otyp - GRAY_DRAGON_SCALES;
+                       otmp->otyp += GRAY_DRAGON_SCALE_MAIL
+                                       - GRAY_DRAGON_SCALES;
                        if (sblessed) {
                            otmp->spe++;
                            if (!otmp->blessed) bless(otmp);