00001
00002
00003
00004
00005
00006
00007
00008 #ifndef ITEMS_H
00009 #define ITEMS_H
00010
00011 #include "externs.h"
00012
00013
00014
00015 enum item_source_type
00016 {
00017 IT_SRC_NONE = 0,
00018
00019
00020
00021 AQ_SCROLL = 100,
00022 AQ_CARD_GENIE,
00023 IT_SRC_START,
00024 IT_SRC_SHOP,
00025
00026
00027
00028 AQ_WIZMODE = 200,
00029 };
00030
00031 int get_max_subtype(object_class_type base_type);
00032
00033 bool dec_inv_item_quantity(int obj, int amount, bool suppress_burden = false);
00034 bool dec_mitm_item_quantity(int obj, int amount);
00035
00036 void inc_inv_item_quantity(int obj, int amount, bool suppress_burden = false);
00037 void inc_mitm_item_quantity(int obj, int amount);
00038
00039 bool move_item_to_grid(int *const obj, const coord_def& p,
00040 bool silent = false);
00041 void move_item_stack_to_grid(const coord_def& from, const coord_def& to);
00042 void note_inscribe_item(item_def &item);
00043 int move_item_to_player(int obj, int quant_got, bool quiet = false,
00044 bool ignore_burden = false);
00045 void mark_items_non_pickup_at(const coord_def &pos);
00046 bool is_stackable_item(const item_def &item);
00047 bool items_similar(const item_def &item1, const item_def &item2,
00048 bool ignore_ident = false);
00049 bool items_stack(const item_def &item1, const item_def &item2,
00050 bool force_merge = false, bool ignore_ident = false);
00051 void merge_item_stacks(item_def &source, item_def &dest,
00052 int quant = -1);
00053
00054 item_def find_item_type(object_class_type base_type, std::string name);
00055 item_def *find_floor_item(object_class_type cls, int sub_type);
00056 int item_on_floor(const item_def &item, const coord_def& where);
00057
00058 void init_item(int item);
00059
00060 void link_items(void);
00061
00062 void fix_item_coordinates(void);
00063
00064 int get_item_slot(int reserve = 50);
00065
00066 void unlink_item(int dest);
00067 void destroy_item(item_def &item, bool never_created = false);
00068 void destroy_item(int dest, bool never_created = false);
00069 void lose_item_stack(const coord_def& where);
00070
00071 void item_check(bool verbose);
00072 void request_autopickup(bool do_pickup = true);
00073
00074 void pickup(bool partial_quantity = false);
00075
00076 int item_name_specialness(const item_def& item);
00077 void item_list_on_square(std::vector<const item_def*>& items,
00078 int obj, bool force_squelch = false);
00079
00080 bool copy_item_to_grid(const item_def &item, const coord_def& p,
00081 int quant_drop = -1,
00082 bool mark_dropped = false,
00083 bool silent = false);
00084
00085 bool move_top_item(const coord_def &src, const coord_def &dest);
00086
00087
00088
00089
00090 const item_def* top_item_at(const coord_def& where, bool allow_mimic_item);
00091 item_def *corpse_at(coord_def pos, int *num_corpses = NULL);
00092
00093
00094 bool multiple_items_at(const coord_def& where, bool allow_mimic_item);
00095
00096 void drop(void);
00097
00098 int inv_count(void);
00099
00100 bool pickup_single_item(int link, int qty);
00101
00102 bool drop_item(int item_dropped, int quant_drop);
00103
00104 int get_equip_slot(const item_def *item);
00105 mon_inv_type get_mon_equip_slot(const monster* mon, const item_def &item);
00106
00107 void origin_reset(item_def &item);
00108 void origin_set(const coord_def& where);
00109 void origin_set_monster(item_def &item, const monster* mons);
00110 bool origin_known(const item_def &item);
00111 bool origin_describable(const item_def &item);
00112 std::string origin_desc(const item_def &item);
00113 void origin_purchased(item_def &item);
00114 void origin_acquired(item_def &item, int agent);
00115 void origin_set_startequip(item_def &item);
00116 void origin_set_unknown(item_def &item);
00117 void origin_set_inventory(void (*oset)(item_def &item));
00118 bool origin_is_god_gift(const item_def& item, god_type *god = NULL);
00119 bool origin_is_acquirement(const item_def& item,
00120 item_source_type *type = NULL);
00121 std::string origin_monster_name(const item_def &item);
00122
00123 bool item_needs_autopickup(const item_def &);
00124 bool can_autopickup();
00125
00126 bool need_to_autopickup();
00127 void autopickup();
00128
00129 int find_free_slot(const item_def &i);
00130
00131 bool need_to_autoinscribe();
00132 void request_autoinscribe(bool do_inscribe = true);
00133 void autoinscribe();
00134
00135 bool item_is_equipped(const item_def &item, bool quiver_too = false);
00136 bool item_is_melded(const item_def& item);
00137 equipment_type item_equip_slot(const item_def &item);
00138
00139 void item_was_lost(const item_def &item);
00140 void item_was_destroyed(const item_def &item, int cause = -1);
00141
00142 bool get_item_by_name(item_def *item, char* specs,
00143 object_class_type class_wanted,
00144 bool create_for_real = false);
00145
00146 void move_items(const coord_def r, const coord_def p);
00147
00148 coord_def orb_position();
00149
00150 #endif