Index: /trunk/src/.depend =================================================================== --- /trunk/src/.depend (revision 194) +++ /trunk/src/.depend (revision 194) @@ -0,0 +1,3 @@ +signals.o: signals.c +main-crb.o: main-crb.c +main-ros.o: main-ros.c Index: /trunk/src/spells1.c =================================================================== --- /trunk/src/spells1.c (revision 152) +++ /trunk/src/spells1.c (revision 194) @@ -753,5 +753,6 @@ char o_name[80]; - + + bool damage; /* Count the casualties */ @@ -775,9 +776,80 @@ int chance = perc * 100; - /* Rods are tough */ - if (o_ptr->tval == TV_ROD) chance = (chance / 4); + damage = FALSE; + + /* Analyze the type to see if we just damage it */ + switch (o_ptr->tval) + { + /* Weapons */ + case TV_BOW: + case TV_SWORD: + case TV_HAFTED: + case TV_POLEARM: + case TV_DIGGING: + { + /* Chance to damage it */ + if (rand_int(100) < perc) + { + /* Damage the item */ + o_ptr->to_h--; + o_ptr->to_d--; + + /* Damaged! */ + damage = TRUE; + } + else continue; + + break; + } + + /* Wearable items */ + case TV_HELM: + case TV_CROWN: + case TV_SHIELD: + case TV_BOOTS: + case TV_GLOVES: + case TV_CLOAK: + case TV_SOFT_ARMOR: + case TV_HARD_ARMOR: + case TV_DRAG_ARMOR: + { + /* Chance to damage it */ + if (rand_int(100) < perc) + { + /* Damage the item */ + o_ptr->to_a--; + + /* Damaged! */ + damage = TRUE; + } + else continue; + + break; + } + + /* Rods are tough */ + case TV_ROD: + { + chance = (chance / 4); + + break; + } + } + + /* Damage instead of destroy */ + if (damage) + { + /* Calculate bonuses */ + p_ptr->update |= (PU_BONUS); + + /* Window stuff */ + p_ptr->window |= (PW_EQUIP | PW_PLAYER_0 | PW_PLAYER_1); + + /* Casualty count */ + amt = o_ptr->number; + } /* Count the casualties */ - for (amt = j = 0; j < o_ptr->number; ++j) + else for (amt = j = 0; j < o_ptr->number; ++j) { if (rand_int(10000) < chance) amt++; @@ -791,10 +863,14 @@ /* Message */ - message_format(MSG_DESTROY, 0, "%sour %s (%c) %s destroyed!", + message_format(MSG_DESTROY, 0, "%sour %s (%c) %s %s!", ((o_ptr->number > 1) ? ((amt == o_ptr->number) ? "All of y" : (amt > 1 ? "Some of y" : "One of y")) : "Y"), o_name, index_to_label(i), - ((amt > 1) ? "were" : "was")); + ((amt > 1) ? "were" : "was"), + (damage ? "damaged" : "destroyed")); + + /* Damage already done? */ + if (damage) continue; /* Hack -- If rods, wands, or staves are destroyed, the total