hit by destroy armor scroll/black dragon breath */
| 3198 | |
| 3199 | /* hit by destroy armor scroll/black dragon breath */ |
| 3200 | int |
| 3201 | disintegrate_arm(struct obj *atmp) |
| 3202 | { |
| 3203 | struct obj *otmp = (struct obj *) 0; |
| 3204 | boolean losing_gloves = FALSE, resisted = FALSE, |
| 3205 | resistedc = FALSE, resistedsuit = FALSE; |
| 3206 | /* |
| 3207 | * Note: if the cloak resisted, then the suit or shirt underneath |
| 3208 | * wouldn't be impacted either. Likewise, if the suit resisted, the |
| 3209 | * shirt underneath wouldn't be impacted. Since there are no artifact |
| 3210 | * cloaks or suits right now, this is unlikely to come into effect, |
| 3211 | * but it should behave appropriately if/when the situation changes. |
| 3212 | */ |
| 3213 | |
| 3214 | if ((otmp = maybe_destroy_armor(uarmc, atmp, &resistedc)) != 0) { |
| 3215 | urgent_pline("Your %s crumbles and turns to dust!", |
| 3216 | /* cloak/robe/apron/smock (ID'd apron)/wrapping */ |
| 3217 | cloak_simple_name(otmp)); |
| 3218 | } else if (!resistedc |
| 3219 | && (otmp = maybe_destroy_armor(uarm, atmp, &resistedsuit)) != 0) { |
| 3220 | const char *suit = suit_simple_name(otmp); |
| 3221 | |
| 3222 | /* for gold DSM, we don't want Armor_gone() to report that it |
| 3223 | stops shining _after_ we've been told that it is destroyed */ |
| 3224 | if (otmp->lamplit) |
| 3225 | end_burn(otmp, FALSE); |
| 3226 | urgent_pline("Your %s %s to dust and %s to the %s!", |
| 3227 | /* suit might be "dragon scales" so vtense() is needed */ |
| 3228 | suit, vtense(suit, "turn"), vtense(suit, "fall"), |
| 3229 | surface(u.ux, u.uy)); |
| 3230 | } else if (!resistedc && !resistedsuit |
| 3231 | && (otmp = maybe_destroy_armor(uarmu, atmp, &resisted)) != 0) { |
| 3232 | urgent_pline("Your %s crumbles into tiny threads and falls apart!", |
| 3233 | shirt_simple_name(otmp)); /* always "shirt" */ |
| 3234 | } else if ((otmp = maybe_destroy_armor(uarmh, atmp, &resisted)) != 0) { |
| 3235 | urgent_pline("Your %s turns to dust and is blown away!", |
| 3236 | helm_simple_name(otmp)); /* "helm" or "hat" */ |
| 3237 | } else if ((otmp = maybe_destroy_armor(uarmg, atmp, &resisted)) != 0) { |
| 3238 | urgent_pline("Your %s vanish!", gloves_simple_name(otmp)); |
| 3239 | losing_gloves = TRUE; |
| 3240 | } else if ((otmp = maybe_destroy_armor(uarmf, atmp, &resisted)) != 0) { |
| 3241 | urgent_pline("Your %s disintegrate!", boots_simple_name(otmp)); |
| 3242 | } else if ((otmp = maybe_destroy_armor(uarms, atmp, &resisted)) != 0) { |
| 3243 | urgent_pline("Your %s crumbles away!", shield_simple_name(otmp)); |
| 3244 | } else { |
| 3245 | return 0; /* could not destroy anything */ |
| 3246 | } |
| 3247 | |
| 3248 | /* cancel_don() if applicable, Cloak_off()/Armor_off()/&c, and useup() */ |
| 3249 | wornarm_destroyed(otmp); |
| 3250 | /* glove loss means wielded weapon will be touched */ |
| 3251 | if (losing_gloves) |
| 3252 | selftouch("You"); |
| 3253 | |
| 3254 | stop_occupation(); |
| 3255 | return 1; |
| 3256 | } |
| 3257 |
no test coverage detected