ball&chain cause hero to randomly lose stuff from inventory */
| 962 | |
| 963 | /* ball&chain cause hero to randomly lose stuff from inventory */ |
| 964 | staticfn void |
| 965 | litter(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 | |
| 985 | void |
| 986 | drag_down(void) |
no test coverage detected