| 1273 | } |
| 1274 | |
| 1275 | staticfn void |
| 1276 | chest_shatter_msg(struct obj *otmp) |
| 1277 | { |
| 1278 | const char *disposition; |
| 1279 | const char *thing; |
| 1280 | long save_HBlinded, save_BBlinded; |
| 1281 | |
| 1282 | if (otmp->oclass == POTION_CLASS) { |
| 1283 | You("%s %s shatter!", Blind ? "hear" : "see", an(bottlename())); |
| 1284 | if (!breathless(gy.youmonst.data) || haseyes(gy.youmonst.data)) |
| 1285 | potionbreathe(otmp); |
| 1286 | return; |
| 1287 | } |
| 1288 | /* We have functions for distant and singular names, but not one */ |
| 1289 | /* which does _both_... */ |
| 1290 | save_HBlinded = HBlinded, save_BBlinded = BBlinded; |
| 1291 | HBlinded = 1L, BBlinded = 0L; |
| 1292 | thing = singular(otmp, xname); |
| 1293 | HBlinded = save_HBlinded, BBlinded = save_BBlinded; |
| 1294 | switch (objects[otmp->otyp].oc_material) { |
| 1295 | case PAPER: |
| 1296 | disposition = "is torn to shreds"; |
| 1297 | break; |
| 1298 | case WAX: |
| 1299 | disposition = "is crushed"; |
| 1300 | break; |
| 1301 | case VEGGY: |
| 1302 | disposition = "is pulped"; |
| 1303 | break; |
| 1304 | case FLESH: |
| 1305 | disposition = "is mashed"; |
| 1306 | break; |
| 1307 | case GLASS: |
| 1308 | disposition = "shatters"; |
| 1309 | break; |
| 1310 | case WOOD: |
| 1311 | disposition = "splinters to fragments"; |
| 1312 | break; |
| 1313 | default: |
| 1314 | disposition = "is destroyed"; |
| 1315 | break; |
| 1316 | } |
| 1317 | pline("%s %s!", An(thing), disposition); |
| 1318 | } |
| 1319 | |
| 1320 | /*lock.c*/ |
no test coverage detected