5 * Object information, for a specific object.
7 * Note that a "discount" on an item is permanent and never goes away.
9 * Note that inscriptions are now handled via the "quark_str()" function
10 * applied to the "note" field, which will return NULL if "note" is zero.
12 * Note that "object" records are "copied" on a fairly regular basis,
13 * and care must be taken when handling such objects.
15 * Note that "object flags" must now be derived from the object kind,
16 * the artifact and ego-item indexes, and the two "xtra" fields.
18 * Each grid points to one (or zero) objects via the "o_idx"
19 * field (above). Each object then points to one (or zero) objects
20 * via the "next_o_idx" field, forming a singly linked list, which
21 * in game terms, represents a "stack" of objects in the same grid.
23 * Each monster points to one (or zero) objects via the "hold_o_idx"
24 * field (below). Each object then points to one (or zero) objects
25 * via the "next_o_idx" field, forming a singly linked list, which
26 * in game terms, represents a pile of objects held by the monster.
28 * The "held_m_idx" field is used to indicate which monster, if any,
29 * is holding the object. Objects being held have "ix=0" and "iy=0".
32 typedef struct object_type object_type;
36 KIND_OBJECT_IDX k_idx; /* Kind index (zero if "dead") */
38 POSITION iy; /* Y-position on map, or zero */
39 POSITION ix; /* X-position on map, or zero */
41 OBJECT_TYPE_VALUE tval; /* Item type (from kind) */
42 OBJECT_SUBTYPE_VALUE sval; /* Item sub-type (from kind) */
44 PARAMETER_VALUE pval; /* Item extra-parameter */
46 DISCOUNT_RATE discount; /* Discount (if any) */
48 ITEM_NUMBER number; /* Number of items */
50 WEIGHT weight; /* Item weight */
52 ARTIFACT_IDX name1; /* Artifact type, if any */
53 EGO_IDX name2; /* Ego-Item type, if any */
55 XTRA8 xtra1; /* Extra info type (now unused) */
56 XTRA8 xtra2; /* Extra info activation index */
57 XTRA8 xtra3; /* Extra info for weaponsmith */
58 XTRA16 xtra4; /*!<
\8cõ
\8c¹
\82Ì
\8ec
\82è
\8eõ
\96½
\81A
\82 \82é
\82¢
\82Í
\95ß
\82ç
\82¦
\82½
\83\82\83\93\83X
\83^
\81[
\82Ì
\8c»HP / Extra info fuel or captured monster's current HP */
59 XTRA16 xtra5; /*!<
\95ß
\82ç
\82¦
\82½
\83\82\83\93\83X
\83^
\81[
\82Ì
\8dÅ
\91åHP / Extra info captured monster's max HP */
61 HIT_PROB to_h; /* Plusses to hit */
62 HIT_POINT to_d; /* Plusses to damage */
63 ARMOUR_CLASS to_a; /* Plusses to AC */
65 ARMOUR_CLASS ac; /* Normal AC */
68 DICE_SID ds; /* Damage dice/sides */
70 TIME_EFFECT timeout; /* Timeout Counter */
72 byte ident; /* Special flags */
73 byte marked; /* Object is marked */
75 u16b inscription; /* Inscription index */
76 u16b art_name; /* Artifact name (random artifacts) */
78 byte feeling; /* Game generated inscription number (eg, pseudo-id) */
80 BIT_FLAGS art_flags[TR_FLAG_SIZE]; /* Extra Flags for ego and artifacts */
81 BIT_FLAGS curse_flags; /* Flags for curse */
83 OBJECT_IDX next_o_idx; /* Next object in stack (if any) */
84 MONSTER_IDX held_m_idx; /* Monster holding us (if any) */
86 ARTIFACT_BIAS_IDX artifact_bias; /*!<
\83\89\83\93\83_
\83\80\83A
\81[
\83e
\83B
\83t
\83@
\83N
\83g
\90¶
\90¬
\8e\9e\82Ì
\83o
\83C
\83A
\83XID */
90 extern ITEM_NUMBER scan_floor(OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode);
91 extern COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_width);
92 extern void reset_visuals(void);
93 extern void object_flags(object_type *o_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE]);
94 extern void object_flags_known(object_type *o_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE]);
95 extern concptr item_activation(object_type *o_ptr);
96 extern bool screen_object(object_type *o_ptr, BIT_FLAGS mode);
97 extern char index_to_label(int i);
98 extern INVENTORY_IDX label_to_inven(int c);
99 extern INVENTORY_IDX label_to_equip(int c);
100 extern s16b wield_slot(object_type *o_ptr);
101 extern concptr mention_use(int i);
102 extern concptr describe_use(int i);
103 extern bool check_book_realm(const OBJECT_TYPE_VALUE book_tval, const OBJECT_SUBTYPE_VALUE book_sval);
104 extern bool item_tester_okay(object_type *o_ptr);
105 extern void display_inven(void);
106 extern void display_equip(void);
107 extern COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode);
108 extern COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode);
109 extern void toggle_inven_equip(void);
110 extern bool can_get_item(void);
111 extern bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode);
112 extern object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option);
113 PERCENTAGE breakage_chance(object_type *o_ptr, SPELL_IDX snipe_type);
115 extern int bow_tval_ammo(object_type *o_ptr);
118 extern void excise_object_idx(OBJECT_IDX o_idx);
119 extern void delete_object_idx(OBJECT_IDX o_idx);
120 extern void delete_object(POSITION y, POSITION x);
121 extern void compact_objects(int size);
122 extern void wipe_o_list(void);
123 extern OBJECT_IDX o_pop(void);
124 extern OBJECT_IDX get_obj_num(DEPTH level, BIT_FLAGS mode);
125 extern void object_known(object_type *o_ptr);
126 extern void object_aware(object_type *o_ptr);
127 extern void object_tried(object_type *o_ptr);
128 extern byte value_check_aux1(object_type *o_ptr);
129 extern byte value_check_aux2(object_type *o_ptr);
130 extern PRICE object_value(object_type *o_ptr);
131 extern PRICE object_value_real(object_type *o_ptr);
132 extern void distribute_charges(object_type *o_ptr, object_type *q_ptr, int amt);
133 extern void reduce_charges(object_type *o_ptr, int amt);
134 extern int object_similar_part(object_type *o_ptr, object_type *j_ptr);
135 extern bool object_similar(object_type *o_ptr, object_type *j_ptr);
136 extern void object_absorb(object_type *o_ptr, object_type *j_ptr);
137 extern IDX lookup_kind(OBJECT_TYPE_VALUE tval, OBJECT_SUBTYPE_VALUE sval);
138 extern void object_wipe(object_type *o_ptr);
139 extern void object_prep(object_type *o_ptr, KIND_OBJECT_IDX k_idx);
140 extern void object_copy(object_type *o_ptr, object_type *j_ptr);
143 * Bit flags for apply_magic() (etc)
145 #define AM_NO_FIXED_ART 0x00000001 /*!< Don't allow roll for fixed artifacts */
146 #define AM_GOOD 0x00000002 /*!< Generate good items */
147 #define AM_GREAT 0x00000004 /*!< Generate great items */
148 #define AM_SPECIAL 0x00000008 /*!< Generate artifacts (for debug mode only) */
149 #define AM_CURSED 0x00000010 /*!< Generate cursed/worthless items */
150 #define AM_FORBID_CHEST 0x00000020 /*!<
\94 \82©
\82ç
\82³
\82ç
\82É
\94 \82ª
\8fo
\8c»
\82·
\82é
\82±
\82Æ
\82ð
\97}
\8e~
\82·
\82é */
151 extern void apply_magic(object_type *o_ptr, DEPTH lev, BIT_FLAGS mode);
153 extern bool make_object(object_type *j_ptr, BIT_FLAGS mode);
154 extern void place_object(POSITION y, POSITION x, BIT_FLAGS mode);
155 extern bool make_gold(object_type *j_ptr);
156 extern void place_gold(POSITION y, POSITION x);
157 extern OBJECT_IDX drop_near(object_type *o_ptr, PERCENTAGE chance, POSITION y, POSITION x);
158 extern void inven_item_charges(INVENTORY_IDX item);
159 extern void inven_item_describe(INVENTORY_IDX item);
160 extern void inven_item_increase(INVENTORY_IDX item, ITEM_NUMBER num);
161 extern void inven_item_optimize(INVENTORY_IDX item);
162 extern void floor_item_charges(INVENTORY_IDX item);
163 extern void floor_item_describe(INVENTORY_IDX item);
164 extern void floor_item_increase(INVENTORY_IDX item, ITEM_NUMBER num);
165 extern void floor_item_optimize(INVENTORY_IDX item);
166 extern bool inven_carry_okay(object_type *o_ptr);
167 extern bool object_sort_comp(object_type *o_ptr, s32b o_value, object_type *j_ptr);
168 extern s16b inven_carry(object_type *o_ptr);
169 extern INVENTORY_IDX inven_takeoff(INVENTORY_IDX item, ITEM_NUMBER amt);
170 extern void inven_drop(INVENTORY_IDX item, ITEM_NUMBER amt);
171 extern void combine_pack(void);
172 extern void reorder_pack(void);
173 extern void display_koff(KIND_OBJECT_IDX k_idx);
174 extern void torch_flags(object_type *o_ptr, BIT_FLAGS *flgs);
175 extern void torch_dice(object_type *o_ptr, DICE_NUMBER *dd, DICE_SID *ds);
176 extern void torch_lost_fuel(object_type *o_ptr);
177 extern concptr essence_name[];
179 extern s32b flag_cost(object_type *o_ptr, int plusses);
181 extern bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode);
182 extern void py_pickup_floor(bool pickup);