OSDN Git Service

[Refactor] #37353 types.h 削除。
[hengband/hengband.git] / src / object.h
1 #pragma once
2 #include "defines.h"
3
4 /*
5  * Object information, for a specific object.
6  *
7  * Note that a "discount" on an item is permanent and never goes away.
8  *
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.
11  *
12  * Note that "object" records are "copied" on a fairly regular basis,
13  * and care must be taken when handling such objects.
14  *
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.
17  *
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.
22  *
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.
27  *
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".
30  */
31
32 typedef struct object_type object_type;
33
34 struct object_type
35 {
36         KIND_OBJECT_IDX k_idx;                  /* Kind index (zero if "dead") */
37
38         POSITION iy;                    /* Y-position on map, or zero */
39         POSITION ix;                    /* X-position on map, or zero */
40
41         OBJECT_TYPE_VALUE tval;                 /* Item type (from kind) */
42         OBJECT_SUBTYPE_VALUE sval;                      /* Item sub-type (from kind) */
43
44         PARAMETER_VALUE pval;                   /* Item extra-parameter */
45
46         DISCOUNT_RATE discount;         /* Discount (if any) */
47
48         ITEM_NUMBER number;     /* Number of items */
49
50         WEIGHT weight;          /* Item weight */
51
52         ARTIFACT_IDX name1;             /* Artifact type, if any */
53         EGO_IDX name2;                  /* Ego-Item type, if any */
54
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 */
60
61         HIT_PROB to_h;                  /* Plusses to hit */
62         HIT_POINT to_d;                 /* Plusses to damage */
63         ARMOUR_CLASS to_a;                      /* Plusses to AC */
64
65         ARMOUR_CLASS ac;                        /* Normal AC */
66
67         DICE_NUMBER dd;
68         DICE_SID ds;            /* Damage dice/sides */
69
70         TIME_EFFECT timeout;    /* Timeout Counter */
71
72         byte ident;                     /* Special flags  */
73         byte marked;            /* Object is marked */
74
75         u16b inscription;       /* Inscription index */
76         u16b art_name;      /* Artifact name (random artifacts) */
77
78         byte feeling;          /* Game generated inscription number (eg, pseudo-id) */
79
80         BIT_FLAGS art_flags[TR_FLAG_SIZE];        /* Extra Flags for ego and artifacts */
81         BIT_FLAGS curse_flags;        /* Flags for curse */
82
83         OBJECT_IDX next_o_idx;  /* Next object in stack (if any) */
84         MONSTER_IDX held_m_idx; /* Monster holding us (if any) */
85
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 */
87 };
88
89 extern int bow_tval_ammo(object_type *o_ptr);