MCPcopy Create free account
hub / github.com/NetHack/NetHack / breakmsg

Function breakmsg

src/dothrow.c:2611–2653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2609}
2610
2611staticfn void
2612breakmsg(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
2655staticfn int
2656throw_gold(struct obj *obj)

Callers 4

toss_upFunction · 0.85
throwitFunction · 0.85
hero_breaksFunction · 0.85
breaksFunction · 0.85

Calls 4

You_hearFunction · 0.85
Doname2Function · 0.85
impossibleFunction · 0.70
plineFunction · 0.70

Tested by

no test coverage detected