Dresses now degrade to ragged shifts when reduced to zero durability
authorMartin Read <martin@blackswordsonics.com>
Tue, 24 Sep 2013 18:37:25 +0000 (19:37 +0100)
committerMartin Read <martin@blackswordsonics.com>
Tue, 24 Sep 2013 18:37:25 +0000 (19:37 +0100)
objects.c

index 17bd443..45ea778 100644 (file)
--- a/objects.c
+++ b/objects.c
@@ -134,7 +134,19 @@ int consume_obj(int obj)
         {
             if (obj == u.armour)
             {
-                u.armour = -1;
+                if ((objects[obj].obj_id == PO_BATTLE_BALLGOWN) ||
+                    (objects[obj].obj_id == PO_IMPERATRIX_GOWN))
+                {
+                    objects[obj].quan = 1;
+                    objects[obj].used = 1;
+                    objects[obj].durability = 50 + zero_die(51);
+                    objects[obj].obj_id = PO_RAGGED_SHIFT;
+                    print_msg("Your dress has been reduced to a tattered wreck.\n");
+                }
+                else
+                {
+                    u.armour = -1;
+                }
                 recalc_defence();
             }
             else if (obj == u.weapon)
@@ -147,12 +159,15 @@ int consume_obj(int obj)
                 u.ring = -1;
                 recalc_defence();
             }
-            for (i = 0; i < 19; i++)
+            if (!objects[obj].used)
             {
-                if (u.inventory[i] == obj)
+                for (i = 0; i < 19; i++)
                 {
-                    u.inventory[i] = -1;
-                    break;
+                    if (u.inventory[i] == obj)
+                    {
+                        u.inventory[i] = -1;
+                        break;
+                    }
                 }
             }
         }
@@ -618,7 +633,6 @@ void damage_obj(int obj)
             print_msg("Your armour is ruined!\n");
         }
         consume_obj(obj);
-        recalc_defence();
     }
     else
     {
@@ -649,7 +663,7 @@ void damage_obj(int obj)
                     int shortfall = (u.food < 0) ? 500 : 500 - u.food;
                     int damage = (shortfall + 24) / 25;
                     u.food = (u.food < 0) ? u.food : 0;
-                    print_msg("Pain explodes through your arm as the lash resotres\nitself!\n");
+                    print_msg("Pain explodes through your arm as the lash restores\nitself!\n");
                     damage_u(damage, DEATH_LASH, "");
                 }
                 else