| 2609 | } |
| 2610 | |
| 2611 | staticfn void |
| 2612 | breakmsg(struct obj *obj, boolean in_view) |
| 2613 | { |
| 2614 | const char *to_pieces; |
| 2615 | |
| 2616 | if (is_crackable(obj)) /* breakobj() will call erode_obj() for message */ |
| 2617 | return; |
| 2618 | |
| 2619 | to_pieces = ""; |
| 2620 | switch (obj->oclass == POTION_CLASS ? POT_WATER : obj->otyp) { |
| 2621 | default: /* glass or crystal wand */ |
| 2622 | if (obj->oclass != WAND_CLASS) |
| 2623 | impossible("breaking odd object (%d)?", obj->otyp); |
| 2624 | FALLTHROUGH; |
| 2625 | /*FALLTHRU*/ |
| 2626 | case LENSES: |
| 2627 | case MIRROR: |
| 2628 | case CRYSTAL_BALL: |
| 2629 | case EXPENSIVE_CAMERA: |
| 2630 | to_pieces = " into a thousand pieces"; |
| 2631 | FALLTHROUGH; |
| 2632 | /*FALLTHRU*/ |
| 2633 | case POT_WATER: /* really, all potions */ |
| 2634 | if (!in_view) |
| 2635 | You_hear("%s shatter!", something); |
| 2636 | else |
| 2637 | pline("%s shatter%s%s!", Doname2(obj), |
| 2638 | (obj->quan == 1L) ? "s" : "", to_pieces); |
| 2639 | break; |
| 2640 | case EGG: |
| 2641 | case MELON: |
| 2642 | pline("Splat!"); |
| 2643 | break; |
| 2644 | case CREAM_PIE: |
| 2645 | if (in_view) |
| 2646 | pline("What a mess!"); |
| 2647 | break; |
| 2648 | case ACID_VENOM: |
| 2649 | case BLINDING_VENOM: |
| 2650 | pline("Splash!"); |
| 2651 | break; |
| 2652 | } |
| 2653 | } |
| 2654 | |
| 2655 | staticfn int |
| 2656 | throw_gold(struct obj *obj) |
no test coverage detected