… | |
… | |
1082 | } |
1082 | } |
1083 | if (present_in_ob (POISONING, mon) != NULL) |
1083 | if (present_in_ob (POISONING, mon) != NULL) |
1084 | new_draw_info (NDI_UNIQUE, 0, op, "It looks very ill."); |
1084 | new_draw_info (NDI_UNIQUE, 0, op, "It looks very ill."); |
1085 | } |
1085 | } |
1086 | |
1086 | |
1087 | |
|
|
1088 | /* tmp is the object being described, pl is who is examing it. */ |
1087 | /* tmp is the object being described, pl is who is examing it. */ |
1089 | char * |
1088 | const char * |
1090 | long_desc (object *tmp, object *pl) |
1089 | long_desc (object *tmp, object *pl) |
1091 | { |
1090 | { |
1092 | static char buf[VERY_BIG_BUF]; |
1091 | static char buf[VERY_BIG_BUF]; |
1093 | char *cp; |
1092 | const char *cp; |
1094 | |
1093 | |
1095 | if (tmp == NULL) |
1094 | if (tmp == NULL) |
1096 | return ""; |
1095 | return ""; |
1097 | |
1096 | |
1098 | buf[0] = '\0'; |
1097 | buf[0] = '\0'; |
… | |
… | |
1115 | case FOOD: |
1114 | case FOOD: |
1116 | case DRINK: |
1115 | case DRINK: |
1117 | case FLESH: |
1116 | case FLESH: |
1118 | case SKILL_TOOL: |
1117 | case SKILL_TOOL: |
1119 | case POWER_CRYSTAL: |
1118 | case POWER_CRYSTAL: |
1120 | if (*(cp = describe_item (tmp, pl)) != '\0') |
1119 | if (*(cp = describe_item (tmp, pl))) |
1121 | { |
1120 | { |
1122 | int len; |
1121 | int len; |
1123 | |
1122 | |
1124 | assign (buf, query_name (tmp)); |
1123 | assign (buf, query_name (tmp)); |
1125 | len = strlen (buf); |
1124 | len = strlen (buf); |
… | |
… | |
1276 | */ |
1275 | */ |
1277 | void |
1276 | void |
1278 | inventory (object *op, object *inv) |
1277 | inventory (object *op, object *inv) |
1279 | { |
1278 | { |
1280 | object *tmp; |
1279 | object *tmp; |
1281 | char *in; |
1280 | const char *in; |
1282 | int items = 0, length; |
1281 | int items = 0, length; |
1283 | |
1282 | |
1284 | if (inv == NULL && op == NULL) |
1283 | if (inv == NULL && op == NULL) |
1285 | { |
1284 | { |
1286 | new_draw_info (NDI_UNIQUE, 0, op, "Inventory of what object?"); |
1285 | new_draw_info (NDI_UNIQUE, 0, op, "Inventory of what object?"); |
1287 | return; |
1286 | return; |
1288 | } |
1287 | } |
|
|
1288 | |
1289 | tmp = inv ? inv->inv : op->inv; |
1289 | tmp = inv ? inv->inv : op->inv; |
1290 | |
1290 | |
1291 | while (tmp) |
1291 | while (tmp) |
1292 | { |
1292 | { |
1293 | if ((!tmp->invisible && |
1293 | if ((!tmp->invisible && |
1294 | (inv == NULL || inv->type == CONTAINER || QUERY_FLAG (tmp, FLAG_APPLIED))) || (!op || QUERY_FLAG (op, FLAG_WIZ))) |
1294 | (inv == NULL || inv->type == CONTAINER || QUERY_FLAG (tmp, FLAG_APPLIED))) || (!op || QUERY_FLAG (op, FLAG_WIZ))) |
1295 | items++; |
1295 | items++; |
1296 | tmp = tmp->below; |
1296 | tmp = tmp->below; |
1297 | } |
1297 | } |
|
|
1298 | |
1298 | if (inv == NULL) |
1299 | if (inv == NULL) |
1299 | { /* player's inventory */ |
1300 | { /* player's inventory */ |
1300 | if (items == 0) |
1301 | if (items == 0) |
1301 | { |
1302 | { |
1302 | new_draw_info (NDI_UNIQUE, 0, op, "You carry nothing."); |
1303 | new_draw_info (NDI_UNIQUE, 0, op, "You carry nothing."); |
… | |
… | |
1319 | { |
1320 | { |
1320 | length = 28; |
1321 | length = 28; |
1321 | in = " "; |
1322 | in = " "; |
1322 | } |
1323 | } |
1323 | } |
1324 | } |
|
|
1325 | |
1324 | for (tmp = inv ? inv->inv : op->inv; tmp; tmp = tmp->below) |
1326 | for (tmp = inv ? inv->inv : op->inv; tmp; tmp = tmp->below) |
1325 | { |
1327 | { |
1326 | if ((!op || !QUERY_FLAG (op, FLAG_WIZ)) && (tmp->invisible || (inv && inv->type != CONTAINER && !QUERY_FLAG (tmp, FLAG_APPLIED)))) |
1328 | if ((!op || !QUERY_FLAG (op, FLAG_WIZ)) && (tmp->invisible || (inv && inv->type != CONTAINER && !QUERY_FLAG (tmp, FLAG_APPLIED)))) |
1327 | continue; |
1329 | continue; |
1328 | if ((!op || QUERY_FLAG (op, FLAG_WIZ))) |
1330 | if ((!op || QUERY_FLAG (op, FLAG_WIZ))) |
1329 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s- %-*.*s (%5d) %-8s", in, length, length, |
1331 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s- %-*.*s (%5d) %-8s", in, length, length, |
1330 | query_name (tmp), tmp->count, query_weight (tmp)); |
1332 | query_name (tmp), tmp->count, query_weight (tmp)); |
1331 | else |
1333 | else |
1332 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s- %-*.*s %-8s", in, length + 8, length + 8, query_name (tmp), query_weight (tmp)); |
1334 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s- %-*.*s %-8s", in, length + 8, length + 8, query_name (tmp), query_weight (tmp)); |
1333 | } |
1335 | } |
|
|
1336 | |
1334 | if (!inv && op) |
1337 | if (!inv && op) |
1335 | { |
|
|
1336 | new_draw_info_format (NDI_UNIQUE, 0, op, "%-*s %-8s", 41, "Total weight :", query_weight (op)); |
1338 | new_draw_info_format (NDI_UNIQUE, 0, op, "%-*s %-8s", 41, "Total weight :", query_weight (op)); |
1337 | } |
|
|
1338 | } |
1339 | } |
1339 | |
1340 | |
1340 | static void |
1341 | static void |
1341 | display_new_pickup (object *op) |
1342 | display_new_pickup (object *op) |
1342 | { |
1343 | { |