MCPcopy Index your code
hub / github.com/NetHack/NetHack / litter

Function litter

src/ball.c:964–983  ·  view source on GitHub ↗

ball&chain cause hero to randomly lose stuff from inventory */

Source from the content-addressed store, hash-verified

962
963/* ball&chain cause hero to randomly lose stuff from inventory */
964staticfn void
965litter(void)
966{
967 struct obj *otmp, *nextobj = 0;
968 int capacity = weight_cap();
969
970 for (otmp = gi.invent; otmp; otmp = nextobj) {
971 nextobj = otmp->nobj;
972 if (otmp != uball && rnd(capacity) <= (int) otmp->owt) {
973 if (canletgo(otmp, "")) {
974 You("drop %s and %s %s down the stairs with you.",
975 yname(otmp), (otmp->quan == 1L) ? "it" : "they",
976 otense(otmp, "fall"));
977 setnotworn(otmp);
978 freeinv(otmp);
979 hitfloor(otmp, FALSE);
980 }
981 }
982 }
983}
984
985void
986drag_down(void)

Callers 1

drag_downFunction · 0.85

Calls 9

weight_capFunction · 0.85
rndFunction · 0.85
canletgoFunction · 0.85
YouFunction · 0.85
ynameFunction · 0.85
otenseFunction · 0.85
setnotwornFunction · 0.85
freeinvFunction · 0.85
hitfloorFunction · 0.85

Tested by

no test coverage detected