From f584f1968f05127acaddfa3374480f6dfb4e4982 Mon Sep 17 00:00:00 2001 From: Martin Read Date: Tue, 24 Sep 2013 19:37:25 +0100 Subject: [PATCH] Dresses now degrade to ragged shifts when reduced to zero durability --- objects.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/objects.c b/objects.c index 17bd443..45ea778 100644 --- 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 -- 2.11.0