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

Function mbag_item_gone

src/pickup.c:2802–2822  ·  view source on GitHub ↗

an object inside a cursed bag of holding is being destroyed */

Source from the content-addressed store, hash-verified

2800
2801/* an object inside a cursed bag of holding is being destroyed */
2802staticfn long
2803mbag_item_gone(boolean held, struct obj *item, boolean silent)
2804{
2805 struct monst *shkp;
2806 long loss = 0L;
2807
2808 if (!silent) {
2809 if (item->dknown)
2810 pline("%s %s vanished!", Doname2(item), otense(item, "have"));
2811 else
2812 You("%s %s disappear!", Blind ? "notice" : "see", doname(item));
2813 }
2814
2815 if (*u.ushops && (shkp = shop_keeper(*u.ushops)) != 0) {
2816 if (held ? (boolean) item->unpaid : costly_spot(u.ux, u.uy))
2817 loss = stolen_value(item, u.ux, u.uy, (boolean) shkp->mpeaceful,
2818 TRUE);
2819 }
2820 obfree(item, (struct obj *) 0);
2821 return loss;
2822}
2823
2824/* used for #loot/apply, #tip, and final disclosure */
2825void

Callers 3

do_boh_explosionFunction · 0.85
boh_lossFunction · 0.85
tipcontainerFunction · 0.85

Calls 9

Doname2Function · 0.85
otenseFunction · 0.85
YouFunction · 0.85
donameFunction · 0.85
shop_keeperFunction · 0.85
costly_spotFunction · 0.85
stolen_valueFunction · 0.85
obfreeFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected