1 /*
2  *  File:       itemname.cc
3  *  Summary:    Misc functions.
4  *  Written by: Linley Henzell
5  *
6  *  Change History (most recent first):
7  *
8  *               <1>     -/--/--        LRH             Created
9  */
10 
11 
12 #ifndef ITEMNAME_H
13 #define ITEMNAME_H
14 
15 #include "externs.h"
16 
17 bool is_vowel( const char chr );
18 
19 /* ***********************************************************************
20  * called from: describe - effects - item_use - shopping
21  * *********************************************************************** */
22 char get_ident_type(char cla, char ty);
23 
24 
25 /* ***********************************************************************
26  * called from: acr - chardump - direct - effects - fight - invent -
27  *              it_use2 - item_use - items - monstuff - mstuff2 - ouch -
28  *              shopping - spells1 - spells2 - spells3
29  * *********************************************************************** */
30 char item_name( const item_def &item, char descrip, char buff[ITEMNAME_SIZE],
31                 bool terse = false );
32 
33 
34 /* ***********************************************************************
35  * called from: beam - describe - fight - item_use - items - monstuff -
36  *              player
37  * *********************************************************************** */
38 int mass_item( const item_def &item );
39 
40 
41 /* ***********************************************************************
42  * called from: debug - describe - dungeon - fight - files - item_use -
43  *              monstuff - mstuff2 - players - spells0
44  * *********************************************************************** */
45 int property( const item_def &item, int prop_type );
46 
47 
48 /* ***********************************************************************
49  * called from: acr
50  * *********************************************************************** */
51 unsigned char check_item_knowledge(void);
52 
53 
54 /* ***********************************************************************
55  * called from: acr
56  * *********************************************************************** */
57 void clear_ids(void);
58 
59 
60 /* ***********************************************************************
61  * called from: direct - fight - food - items - monstuff - religion -
62  *              shopping
63  * *********************************************************************** */
64 void it_name(int itn, char des, char buff[ITEMNAME_SIZE], bool terse = false);
65 
66 /* ***********************************************************************
67  * called from: acr - chardump - command - effects - fight - invent -
68  *              it_use2 - it_use3 - item_use - items - ouch - output -
69  *              spell - spells1 - spells2 - spells3 - spells4 - transfor
70  * *********************************************************************** */
71 void in_name(int inn, char des, char buff[ITEMNAME_SIZE], bool terse = false);
72 
73 /* ***********************************************************************
74  * called from: itemname.cc items.cc item_use.cc mstuff2.cc
75  * *********************************************************************** */
76 void quant_name( const item_def &item, int quant, char des,
77                  char buff[ITEMNAME_SIZE], bool terse = false );
78 
79 /* ***********************************************************************
80  * bit operations called from a large number of files
81  * *********************************************************************** */
82 bool item_cursed( const item_def &item );
83 bool item_uncursed( const item_def &item );
84 
85 bool item_known_cursed( const item_def &item );
86 bool item_known_uncursed( const item_def &item );
87 // bool fully_indentified( const item_def &item );
88 
89 bool item_ident( const item_def &item, unsigned long flags );
90 bool item_not_ident( const item_def &item, unsigned long flags );
91 
92 void do_curse_item(  item_def &item );
93 void do_uncurse_item(  item_def &item );
94 
95 void set_ident_flags( item_def &item, unsigned long flags );
96 void unset_ident_flags( item_def &item, unsigned long flags );
97 
98 void set_equip_race( item_def &item, unsigned long flags );
99 void set_equip_desc( item_def &item, unsigned long flags );
100 
101 unsigned long get_equip_race( const item_def &item );
102 unsigned long get_equip_desc( const item_def &item );
103 
104 bool cmp_equip_race( const item_def &item, unsigned long val );
105 bool cmp_equip_desc( const item_def &item, unsigned long val );
106 
107 void set_helmet_type( item_def &item, short flags );
108 void set_helmet_desc( item_def &item, short flags );
109 void set_helmet_random_desc( item_def &item );
110 
111 short get_helmet_type( const item_def &item );
112 short get_helmet_desc( const item_def &item );
113 
114 bool cmp_helmet_type( const item_def &item, short val );
115 bool cmp_helmet_desc( const item_def &item, short val );
116 
117 bool set_item_ego_type( item_def &item, int item_type, int ego_type );
118 
119 int get_weapon_brand( const item_def &item );
120 int get_ammo_brand( const item_def &item );
121 int get_armour_ego_type( const item_def &item );
122 
123 bool item_is_rod( const item_def &item );
124 bool item_is_staff( const item_def &item );
125 
126 /* ***********************************************************************
127  * called from: acr
128  * *********************************************************************** */
129 void init_properties(void);
130 
131 /* ***********************************************************************
132  * called from: files - randart - shopping
133  * *********************************************************************** */
134 void make_name( unsigned char var1, unsigned char var2, unsigned char var3,
135                 char ncase, char buff[ITEMNAME_SIZE] );
136 
137 
138 /* ***********************************************************************
139  * called from: files - shopping
140  * *********************************************************************** */
141 void save_id(char identy[4][50]);
142 
143 
144 /* ***********************************************************************
145  * called from: files - item_use - newgame - ouch - shopping - spells1
146  * *********************************************************************** */
147 void set_ident_type( char cla, char ty, char setting, bool force = false );
148 
149 
150 /* ***********************************************************************
151  * called from: dungeon - item_use
152  * *********************************************************************** */
153 bool hide2armour( unsigned char *which_subtype );
154 
155 
156 #endif
157