… | |
… | |
1159 | object::describe_item (object *who) |
1159 | object::describe_item (object *who) |
1160 | { |
1160 | { |
1161 | return std::string (::describe_item (this, who)); |
1161 | return std::string (::describe_item (this, who)); |
1162 | } |
1162 | } |
1163 | |
1163 | |
|
|
1164 | void |
|
|
1165 | examine (object *op, object *tmp) |
|
|
1166 | { |
|
|
1167 | std::string s = tmp->describe (op); |
|
|
1168 | |
|
|
1169 | new_draw_info (NDI_UNIQUE, 0, op, s.c_str ()); |
|
|
1170 | } |
|
|
1171 | |
|
|
1172 | /* |
|
|
1173 | * inventory prints object's inventory. If inv==NULL then print player's |
|
|
1174 | * inventory. |
|
|
1175 | * [ Only items which are applied are showed. Tero.Haatanen@lut.fi ] |
|
|
1176 | */ |
|
|
1177 | const char * |
|
|
1178 | object::query_inventory (object *who, const char *indent) |
|
|
1179 | { |
|
|
1180 | static dynbuf_text buf; buf.clear (); |
|
|
1181 | |
|
|
1182 | for (object *tmp = inv; tmp; tmp = tmp->below) |
|
|
1183 | if (who && QUERY_FLAG (who, FLAG_WIZ)) |
|
|
1184 | buf.printf ("%s- %-28.28s (%5d) %-8s\n", indent, query_name (tmp), tmp->count, query_weight (tmp)); |
|
|
1185 | else if (!tmp->invisible && (type == CONTAINER || QUERY_FLAG (tmp, FLAG_APPLIED))) |
|
|
1186 | buf.printf ("%s- %-36.36s %-8s\n", indent, query_name (tmp), query_weight (tmp)); |
|
|
1187 | |
|
|
1188 | if (buf.size ()) |
|
|
1189 | buf.printf ("%s(total weight: %s)\n", indent, query_weight (this)); |
|
|
1190 | else |
|
|
1191 | buf.printf ("%s(empty)\n", indent); |
|
|
1192 | |
|
|
1193 | return buf; |
|
|
1194 | } |
|
|
1195 | |
1164 | /* Return true if the item is magical. A magical item is one that |
1196 | /* Return true if the item is magical. A magical item is one that |
1165 | * increases/decreases any abilities, provides a resistance, |
1197 | * increases/decreases any abilities, provides a resistance, |
1166 | * has a generic magical bonus, or is an artifact. |
1198 | * has a generic magical bonus, or is an artifact. |
1167 | * This function is used by detect_magic to determine if an item |
1199 | * This function is used by detect_magic to determine if an item |
1168 | * should be marked as magical. |
1200 | * should be marked as magical. |