Apply the new ground_level method.
[crawl.git] / crawl-ref / source / item_use.h
blob1a1bc0f4b97203e0ee1b5cb7ec4e6f63a11da4ec
1 /*
2 * File: item_use.h
3 * Summary: Functions for making use of inventory items.
4 * Written by: Linley Henzell
5 */
8 #ifndef ITEM_USE_H
9 #define ITEM_USE_H
12 #include <string>
13 #include "externs.h"
14 #include "enum.h"
16 struct bolt;
18 enum enchant_stat_type
20 ENCHANT_TO_HIT,
21 ENCHANT_TO_DAM,
24 enum fire_type
26 FIRE_NONE = 0x0000,
27 FIRE_LAUNCHER = 0x0001,
28 FIRE_DART = 0x0002,
29 FIRE_STONE = 0x0004,
30 FIRE_DAGGER = 0x0008,
31 FIRE_JAVELIN = 0x0010,
32 FIRE_SPEAR = 0x0020,
33 FIRE_HAND_AXE = 0x0040,
34 FIRE_CLUB = 0x0080,
35 FIRE_ROCK = 0x0100,
36 FIRE_NET = 0x0200,
37 FIRE_RETURNING = 0x0400,
38 FIRE_INSCRIBED = 0x0800, // Only used for _get_fire_order
41 struct bolt;
42 class dist;
44 bool armour_prompt(const std::string & mesg, int *index, operation_types oper);
46 bool takeoff_armour(int index);
48 void drink(int slot = -1);
50 bool elemental_missile_beam(int launcher_brand, int ammo_brand);
52 bool safe_to_remove(const item_def &item, bool quiet = false);
54 void examine_object(void);
56 bool puton_ring(int slot = -1);
58 void read_scroll(int slot = -1);
60 bool remove_ring(int slot = -1, bool announce = false);
62 bool item_is_quivered(const item_def &item);
63 int get_next_fire_item(int current, int offset);
64 int get_ammo_to_shoot(int item, dist &target, bool teleport = false);
65 void fire_thing(int item = -1);
66 void throw_item_no_quiver(void);
68 void wear_armour(int slot = -1);
70 bool can_wear_armour(const item_def &item, bool verbose, bool ignore_temporary);
72 bool do_wear_armour(int item, bool quiet);
74 struct item_def;
76 bool can_wield(item_def *weapon, bool say_why = false,
77 bool ignore_temporary_disability = false);
79 bool wield_weapon(bool auto_wield, int slot = -1,
80 bool show_weff_messages = true, bool force = false,
81 bool show_unwield_msg = true,
82 bool show_wield_msg = true);
84 void zap_wand(int slot = -1);
86 bool puton_item(int slot);
88 bool enchant_weapon(enchant_stat_type which_stat, bool quiet, item_def &wpn);
89 bool enchant_armour(int &ac_change, bool quiet, item_def &arm);
91 bool setup_missile_beam(const actor *actor, bolt &beam, item_def &item,
92 std::string &ammo_name, bool &returning);
94 void throw_noise(actor* act, const bolt &pbolt, const item_def &ammo);
96 bool throw_it(bolt &pbolt, int throw_2, bool teleport = false,
97 int acc_bonus = 0, dist *target = NULL);
99 bool thrown_object_destroyed(item_def *item, const coord_def& where);
101 void prompt_inscribe_item();
102 int launcher_shield_slowdown(const item_def &launcher,
103 const item_def *shield);
104 int launcher_final_speed(const item_def &launcher,
105 const item_def *shield);
107 void warn_shield_penalties();
109 bool wearing_slot(int inv_slot);
111 bool item_blocks_teleport(bool calc_unid, bool permit_id);
112 bool stasis_blocks_effect(bool calc_unid, bool identify,
113 const char *msg, int noise = 0,
114 const char *silencedmsg = NULL);
116 #ifdef USE_TILE
117 void tile_item_use_floor(int idx);
118 void tile_item_pickup(int idx, bool part);
119 void tile_item_drop(int idx, bool partdrop);
120 void tile_item_eat_floor(int idx);
121 void tile_item_use(int idx);
122 void tile_item_use_secondary(int idx);
123 #endif
125 #endif