destroy a random cursed armor worn by hero */
| 1291 | |
| 1292 | /* destroy a random cursed armor worn by hero */ |
| 1293 | staticfn boolean |
| 1294 | disintegrate_cursed_armor(void) |
| 1295 | { |
| 1296 | struct obj *armors[10]; |
| 1297 | int idx = 0; |
| 1298 | |
| 1299 | armors[0] = NULL; |
| 1300 | if (uarm && uarm->cursed) |
| 1301 | armors[idx++] = uarm; |
| 1302 | if (uarmc && uarmc->cursed) |
| 1303 | armors[idx++] = uarmc; |
| 1304 | if (uarmh && uarmh->cursed) |
| 1305 | armors[idx++] = uarmh; |
| 1306 | if (uarms && uarms->cursed) |
| 1307 | armors[idx++] = uarms; |
| 1308 | if (uarmg && uarmg->cursed) |
| 1309 | armors[idx++] = uarmg; |
| 1310 | if (uarmf && uarmf->cursed) |
| 1311 | armors[idx++] = uarmf; |
| 1312 | if (uarmu && uarmu->cursed) |
| 1313 | armors[idx++] = uarmu; |
| 1314 | if (!idx) |
| 1315 | return FALSE; |
| 1316 | |
| 1317 | if (disintegrate_arm(armors[rn2(idx)])) |
| 1318 | return TRUE; |
| 1319 | |
| 1320 | return FALSE; |
| 1321 | } |
| 1322 | |
| 1323 | staticfn void |
| 1324 | seffect_destroy_armor(struct obj **sobjp) |
no test coverage detected