summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemprop.h
blob: e080c7ac22b61fda36f0a7abfe2e6f9effad6177 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/*
 *  File:       itemprop.h
 *  Summary:    Misc functions.
 *  Written by: Brent Ross
 */


#ifndef ITEMPROP_H
#define ITEMPROP_H

#include "itemprop-enum.h"

struct bolt;

void init_properties(void);

// cursed:
bool item_known_cursed( const item_def &item );
bool item_known_uncursed( const item_def &item );
void do_curse_item( item_def &item, bool quiet = true );
void do_uncurse_item( item_def &item );

// stationary:
void set_item_stationary( item_def &item );
void remove_item_stationary( item_def &item );
bool item_is_stationary( const item_def &item );

// ident:
bool item_ident( const item_def &item, unsigned long flags );
void set_ident_flags( item_def &item, unsigned long flags );
void unset_ident_flags( item_def &item, unsigned long flags );
bool fully_identified( const item_def &item );
unsigned long full_ident_mask( const item_def& item );

// racial item and item descriptions:
void set_equip_race( item_def &item, unsigned long flags );
void set_equip_desc( item_def &item, unsigned long flags );
unsigned long get_equip_race( const item_def &item );
unsigned long get_equip_desc( const item_def &item );

// helmet functions:
void  set_helmet_desc( item_def &item, short flags );
void  set_helmet_random_desc( item_def &item );

short get_helmet_desc( const item_def &item );

bool  is_helmet( const item_def& item );
bool  is_hard_helmet( const item_def& item );

short get_gloves_desc( const item_def &item );
void  set_gloves_random_desc( item_def &item );

// ego items:
bool set_item_ego_type( item_def &item, int item_type, int ego_type );
int  get_weapon_brand( const item_def &item );
special_armour_type get_armour_ego_type( const item_def &item );
int  get_ammo_brand( const item_def &item );

// armour functions:
int armour_max_enchant( const item_def &item );
bool armour_is_hide( const item_def &item, bool inc_made = false );

equipment_type get_armour_slot( const item_def &item );
equipment_type get_armour_slot( armour_type arm );

bool jewellery_is_amulet( const item_def &item );
bool jewellery_is_amulet( int sub_type );

bool  hide2armour( item_def &item );

bool  base_armour_is_light( const item_def &item );
int   fit_armour_size( const item_def &item, size_type size );
bool  check_armour_size( const item_def &item, size_type size );

bool item_is_rechargeable(const item_def &it, bool hide_charged = false,
                          bool weapons = false);
int wand_charge_value(int type);
bool is_enchantable_weapon(const item_def &wpn, bool uncurse,
                           bool first = true);
bool is_enchantable_armour(const item_def &arm, bool uncurse,
                           bool unknown = false);

bool is_shield(const item_def &item);
bool is_shield_incompatible(const item_def &weapon,
                            const item_def *shield = NULL);
bool shield_reflects(const item_def &shield);
void ident_reflector(item_def *item);

// Only works for armour/weapons/missiles
// weapon functions:
int weapon_rarity( int w_type );

int   cmp_weapon_size( const item_def &item, size_type size );
int   fit_weapon_wieldable_size( const item_def &item, size_type size );
bool  check_weapon_wieldable_size( const item_def &item, size_type size );

int   fit_item_throwable_size( const item_def &item, size_type size );

int weapon_ev_bonus( const item_def &wpn, int skill, size_type body, int dex,
                     bool hide_hidden = false );

hands_reqd_type  hands_reqd( const item_def &item, size_type size );
hands_reqd_type hands_reqd(object_class_type base_type, int sub_type,
                           size_type size);

bool is_demonic(const item_def &item);
bool is_blessed(const item_def &item);
bool is_blessed_convertible(const item_def &item);
bool convert2good(item_def &item, bool allow_blessed = true);
bool convert2bad(item_def &item);

int get_vorpal_type(const item_def &item);
int get_damage_type(const item_def &item);
bool does_damage_type(const item_def &item, int dam_type);
int single_damage_type(const item_def &item);

int weapon_str_weight( const item_def &wpn );
int weapon_dex_weight( const item_def &wpn );

skill_type weapon_skill( const item_def &item );
skill_type weapon_skill( object_class_type wclass, int wtype );

skill_type range_skill( const item_def &item );
skill_type range_skill( object_class_type wclass, int wtype );

// launcher and ammo functions:
bool is_range_weapon(const item_def &item);
bool is_range_weapon_type(weapon_type wtype);
missile_type fires_ammo_type(const item_def &item);
missile_type fires_ammo_type(weapon_type wtype);
const char *ammo_name(missile_type ammo);
const char *ammo_name(const item_def &bow);
bool has_launcher(const item_def &ammo);
bool is_throwable(const actor *actor, const item_def &wpn, bool force = false);
launch_retval is_launched(const actor *actor, const item_def *launcher,
                          const item_def &missile);

// staff/rod functions:
bool item_is_rod( const item_def &item );
bool item_is_staff( const item_def &item );

// ring functions:
int  ring_has_pluses( const item_def &item );
bool ring_has_stackable_effect( const item_def &item );

// food functions:
bool food_is_meat(const item_def &item);
bool food_is_veg(const item_def &item);
bool is_blood_potion(const item_def &item);
int food_value(const item_def &item);
int food_turns(const item_def &item);
bool can_cut_meat(const item_def &item);
bool food_is_rotten(const item_def &item);
int corpse_freshness(const item_def &item);
bool is_fruit(const item_def & item);

// generic item property functions:
int property(const item_def &item, int prop_type);
bool gives_ability(const item_def &item);
bool gives_resistance(const item_def &item);
int item_mass(const item_def &item);
size_type item_size(const item_def &item);
equipment_type get_item_slot(object_class_type type, int sub_type);
equipment_type get_item_slot(const item_def& item);

std::string item_base_name(const item_def &item);
const char* weapon_base_name(unsigned char subtype);

void seen_item(const item_def &item);
#endif