pickup_object()/out_container() helper; print an added-to-invent message for current object, limiting feedback about encumbrance to the first item which causes that to change */
| 1945 | print an added-to-invent message for current object, limiting feedback |
| 1946 | about encumbrance to the first item which causes that to change */ |
| 1947 | staticfn void |
| 1948 | pickup_prinv( |
| 1949 | struct obj *obj, |
| 1950 | long count, |
| 1951 | const char *verb) |
| 1952 | { |
| 1953 | char pbuf[QBUFSZ]; |
| 1954 | const char *prefix; |
| 1955 | int nearload = near_capacity(); |
| 1956 | |
| 1957 | pbuf[0] = '\0'; |
| 1958 | if (nearload == gp.pickup_encumbrance) { |
| 1959 | prefix = (char *) 0; |
| 1960 | } else { |
| 1961 | prefix = (nearload >= EXT_ENCUMBER) ? overloadpfx |
| 1962 | : (nearload >= HVY_ENCUMBER) ? nearloadpfx |
| 1963 | : (nearload >= MOD_ENCUMBER) ? moderateloadpfx |
| 1964 | : (nearload >= SLT_ENCUMBER) ? slightloadpfx |
| 1965 | : (char *) 0; |
| 1966 | gp.pickup_encumbrance = nearload; |
| 1967 | } |
| 1968 | if (prefix) |
| 1969 | Sprintf(pbuf, "%s %s", prefix, verb); |
| 1970 | |
| 1971 | prinv(pbuf, obj, count); |
| 1972 | } |
| 1973 | |
| 1974 | /* |
| 1975 | * prints a message if encumbrance changed since the last check |
no test coverage detected