00001
00002
00003
00004
00005
00006
00007
00008 #ifndef ITEMNAME_H
00009 #define ITEMNAME_H
00010
00011 #include "externs.h"
00012
00013 #define CORPSE_NAME_KEY "corpse_name_key"
00014 #define CORPSE_NAME_TYPE_KEY "corpse_name_type_key"
00015
00016 struct item_types_pair
00017 {
00018 object_class_type base_type;
00019 uint8_t sub_type;
00020 };
00021
00022 enum item_type_id_type
00023 {
00024 IDTYPE_WANDS = 0,
00025 IDTYPE_SCROLLS,
00026 IDTYPE_JEWELLERY,
00027 IDTYPE_POTIONS,
00028 IDTYPE_STAVES,
00029 NUM_IDTYPE
00030 };
00031
00032
00033
00034 enum potion_description_colour_type
00035 {
00036 PDC_CLEAR,
00037 PDC_BLUE,
00038 PDC_BLACK,
00039 PDC_SILVERY,
00040 PDC_CYAN,
00041 PDC_PURPLE,
00042 PDC_ORANGE,
00043 PDC_INKY,
00044 PDC_RED,
00045 PDC_YELLOW,
00046 PDC_GREEN,
00047 PDC_BROWN,
00048 PDC_PINK,
00049 PDC_WHITE,
00050 PDC_NCOLOURS
00051 };
00052
00053
00054
00055 enum potion_description_qualifier_type
00056 {
00057 PDQ_NONE,
00058 PDQ_BUBBLING,
00059 PDQ_FUMING,
00060 PDQ_FIZZY,
00061 PDQ_VISCOUS,
00062 PDQ_LUMPY,
00063 PDQ_SMOKY,
00064 PDQ_GLOWING,
00065 PDQ_SEDIMENTED,
00066 PDQ_METALLIC,
00067 PDQ_MURKY,
00068 PDQ_GLUGGY,
00069 PDQ_OILY,
00070 PDQ_SLIMY,
00071 PDQ_EMULSIFIED,
00072 PDQ_NQUALS
00073 };
00074
00075
00076
00077 enum
00078 {
00079 NDSC_JEWEL_PRI = 13,
00080 NDSC_JEWEL_SEC = 13,
00081 NDSC_STAVE_PRI = 4,
00082 NDSC_STAVE_SEC = 10,
00083 NDSC_WAND_PRI = 12,
00084 NDSC_WAND_SEC = 16,
00085 NDSC_POT_PRI = PDC_NCOLOURS,
00086 NDSC_POT_SEC = PDQ_NQUALS,
00087 NDSC_BOOK_PRI = 10,
00088 NDSC_BOOK_SEC = 8,
00089 };
00090
00091 bool is_vowel(const char chr);
00092 int property(const item_def &item, int prop_type);
00093
00094 const char* racial_description_string(const item_def& item, bool terse = false);
00095
00096 bool check_item_knowledge(bool quiet = false, bool inverted = false);
00097
00098 std::string quant_name(const item_def &item, int quant,
00099 description_level_type des, bool terse = false);
00100
00101 bool item_type_known(const item_def &item);
00102 bool item_type_unknown(const item_def &item);
00103 bool item_type_known(const object_class_type base_type, const int sub_type);
00104 bool item_type_tried(const item_def &item);
00105
00106 bool is_interesting_item(const item_def& item);
00107 bool is_emergency_item(const item_def& item);
00108 bool is_good_item(const item_def &item);
00109 bool is_bad_item(const item_def &item, bool temp = false);
00110 bool is_dangerous_item(const item_def& item, bool temp = false);
00111 bool is_useless_item(const item_def &item, bool temp = false);
00112
00113 std::string make_name(uint32_t seed, bool all_caps, int maxlen = -1,
00114 char start = 0);
00115
00116 const char* weapon_brand_name(const item_def& item, bool terse);
00117 const char* armour_ego_name(const item_def& item, bool terse);
00118
00119 void init_properties();
00120
00121 const int NUM_ID_SUBTYPE = 50;
00122 typedef FixedArray<item_type_id_state_type, NUM_IDTYPE, NUM_ID_SUBTYPE> id_arr;
00123
00124 id_arr& get_typeid_array();
00125 CrawlHashTable& get_type_id_props();
00126
00127 item_type_id_state_type get_ident_type(const item_def &item);
00128 item_type_id_state_type get_ident_type(object_class_type basetype,
00129 int subtype);
00130 void set_ident_type(item_def &item, item_type_id_state_type setting,
00131 bool force = false);
00132 void set_ident_type(object_class_type basetype, int subtype,
00133 item_type_id_state_type setting, bool force = false);
00134
00135 std::string menu_colour_item_prefix(const item_def &item, bool temp = true);
00136 std::string filtering_item_prefix(const item_def &item, bool temp = true);
00137 std::string get_menu_colour_prefix_tags(const item_def &item,
00138 description_level_type desc);
00139 std::string get_message_colour_tags(const item_def &item,
00140 description_level_type desc,
00141 msg_channel_type channel = MSGCH_PLAIN);
00142
00143 void init_item_name_cache();
00144 item_types_pair item_types_by_name(std::string name);
00145
00146 std::vector<std::string> item_name_list_for_glyph(unsigned glyph);
00147
00148 const char* wand_type_name(int wandtype);
00149
00150 bool is_named_corpse(const item_def &corpse);
00151 std::string get_corpse_name(const item_def &corpse,
00152 uint64_t *name_type = NULL);
00153 std::string base_type_string (object_class_type type, bool known = true);
00154 std::string base_type_string (const item_def &item, bool known = true);
00155
00156 std::string sub_type_string (object_class_type type, int sub_type, bool known = true, int plus = 0);
00157 std::string sub_type_string (const item_def &item, bool known = true);
00158
00159 std::string ego_type_string (const item_def &item);
00160 #endif