00001
00002
00003
00004
00005
00006
00007
00008 #ifndef ITEM_USE_H
00009 #define ITEM_USE_H
00010
00011
00012 #include <string>
00013 #include "externs.h"
00014 #include "enum.h"
00015
00016 struct bolt;
00017
00018 enum enchant_stat_type
00019 {
00020 ENCHANT_TO_HIT,
00021 ENCHANT_TO_DAM,
00022 };
00023
00024 enum fire_type
00025 {
00026 FIRE_NONE = 0x0000,
00027 FIRE_LAUNCHER = 0x0001,
00028 FIRE_DART = 0x0002,
00029 FIRE_STONE = 0x0004,
00030 FIRE_DAGGER = 0x0008,
00031 FIRE_JAVELIN = 0x0010,
00032 FIRE_SPEAR = 0x0020,
00033 FIRE_HAND_AXE = 0x0040,
00034 FIRE_CLUB = 0x0080,
00035 FIRE_ROCK = 0x0100,
00036 FIRE_NET = 0x0200,
00037 FIRE_RETURNING = 0x0400,
00038 FIRE_INSCRIBED = 0x0800,
00039 };
00040
00041 struct bolt;
00042 class dist;
00043
00044 bool armour_prompt(const std::string & mesg, int *index, operation_types oper);
00045
00046 bool takeoff_armour(int index);
00047
00048 void drink(int slot = -1);
00049
00050 bool elemental_missile_beam(int launcher_brand, int ammo_brand);
00051
00052 bool safe_to_remove(const item_def &item, bool quiet = false);
00053
00054 void examine_object(void);
00055
00056 bool puton_ring(int slot = -1);
00057
00058 void read_scroll(int slot = -1);
00059
00060 bool remove_ring(int slot = -1, bool announce = false);
00061
00062 bool item_is_quivered(const item_def &item);
00063 int get_next_fire_item(int current, int offset);
00064 int get_ammo_to_shoot(int item, dist &target, bool teleport = false);
00065 void fire_thing(int item = -1);
00066 void throw_item_no_quiver(void);
00067
00068 void wear_armour(int slot = -1);
00069
00070 bool can_wear_armour(const item_def &item, bool verbose, bool ignore_temporary);
00071
00072 bool do_wear_armour(int item, bool quiet);
00073
00074 struct item_def;
00075
00076 bool can_wield(item_def *weapon, bool say_why = false,
00077 bool ignore_temporary_disability = false);
00078
00079 bool wield_weapon(bool auto_wield, int slot = -1,
00080 bool show_weff_messages = true, bool force = false,
00081 bool show_unwield_msg = true,
00082 bool show_wield_msg = true);
00083
00084 void zap_wand(int slot = -1);
00085
00086 bool puton_item(int slot);
00087
00088 bool enchant_weapon(enchant_stat_type which_stat, bool quiet, item_def &wpn);
00089 bool enchant_armour(int &ac_change, bool quiet, item_def &arm);
00090
00091 bool setup_missile_beam(const actor *actor, bolt &beam, item_def &item,
00092 std::string &ammo_name, bool &returning);
00093
00094 void throw_noise(actor* act, const bolt &pbolt, const item_def &ammo);
00095
00096 bool throw_it(bolt &pbolt, int throw_2, bool teleport = false,
00097 int acc_bonus = 0, dist *target = NULL);
00098
00099 bool thrown_object_destroyed(item_def *item, const coord_def& where);
00100
00101 void prompt_inscribe_item();
00102 int launcher_shield_slowdown(const item_def &launcher,
00103 const item_def *shield);
00104 int launcher_final_speed(const item_def &launcher,
00105 const item_def *shield);
00106
00107 void warn_shield_penalties();
00108
00109 bool wearing_slot(int inv_slot);
00110
00111 bool item_blocks_teleport(bool calc_unid, bool permit_id);
00112 bool stasis_blocks_effect(bool calc_unid, bool identify,
00113 const char *msg, int noise = 0,
00114 const char *silencedmsg = NULL);
00115
00116 #ifdef USE_TILE
00117 void tile_item_use_floor(int idx);
00118 void tile_item_pickup(int idx, bool part);
00119 void tile_item_drop(int idx, bool partdrop);
00120 void tile_item_eat_floor(int idx);
00121 void tile_item_use(int idx);
00122 void tile_item_use_secondary(int idx);
00123 #endif
00124
00125 #endif