OSDN Git Service

[Refactor] #37353 object_type 構造体を object.h に移動.
authordeskull <deskull@users.sourceforge.jp>
Wed, 1 May 2019 04:26:41 +0000 (13:26 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 1 May 2019 04:47:08 +0000 (13:47 +0900)
src/artifact.c
src/externs.h
src/object.h
src/types.h

index 2d6769c..78d6c13 100644 (file)
@@ -18,6 +18,7 @@
 #include "avatar.h"
 #include "floor.h"
 #include "cmd-activate.h"
+#include "object.h"
 #include "objectkind.h"
 #include "object-boost.h"
 #include "object-curse.h"
index 1444bc0..c05200a 100644 (file)
@@ -17,6 +17,7 @@
 #include "floor-save.h"
 #include "monster.h"
 #include "monsterrace.h"
+#include "object.h"
 
 /*
  * Automatically generated "variable" declarations
index b57358a..8770ffd 100644 (file)
@@ -1,3 +1,88 @@
 #pragma once
 
+/*
+ * Object information, for a specific object.
+ *
+ * Note that a "discount" on an item is permanent and never goes away.
+ *
+ * Note that inscriptions are now handled via the "quark_str()" function
+ * applied to the "note" field, which will return NULL if "note" is zero.
+ *
+ * Note that "object" records are "copied" on a fairly regular basis,
+ * and care must be taken when handling such objects.
+ *
+ * Note that "object flags" must now be derived from the object kind,
+ * the artifact and ego-item indexes, and the two "xtra" fields.
+ *
+ * Each grid points to one (or zero) objects via the "o_idx"
+ * field (above).  Each object then points to one (or zero) objects
+ * via the "next_o_idx" field, forming a singly linked list, which
+ * in game terms, represents a "stack" of objects in the same grid.
+ *
+ * Each monster points to one (or zero) objects via the "hold_o_idx"
+ * field (below).  Each object then points to one (or zero) objects
+ * via the "next_o_idx" field, forming a singly linked list, which
+ * in game terms, represents a pile of objects held by the monster.
+ *
+ * The "held_m_idx" field is used to indicate which monster, if any,
+ * is holding the object.  Objects being held have "ix=0" and "iy=0".
+ */
+
+typedef struct object_type object_type;
+
+struct object_type
+{
+       KIND_OBJECT_IDX k_idx;                  /* Kind index (zero if "dead") */
+
+       POSITION iy;                    /* Y-position on map, or zero */
+       POSITION ix;                    /* X-position on map, or zero */
+
+       OBJECT_TYPE_VALUE tval;                 /* Item type (from kind) */
+       OBJECT_SUBTYPE_VALUE sval;                      /* Item sub-type (from kind) */
+
+       PARAMETER_VALUE pval;                   /* Item extra-parameter */
+
+       DISCOUNT_RATE discount;         /* Discount (if any) */
+
+       ITEM_NUMBER number;     /* Number of items */
+
+       WEIGHT weight;          /* Item weight */
+
+       ARTIFACT_IDX name1;             /* Artifact type, if any */
+       EGO_IDX name2;                  /* Ego-Item type, if any */
+
+       XTRA8 xtra1;                    /* Extra info type (now unused) */
+       XTRA8 xtra2;                    /* Extra info activation index */
+       XTRA8 xtra3;                    /* Extra info for weaponsmith */
+       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 */
+       XTRA16 xtra5;                   /*!< \95ß\82ç\82¦\82½\83\82\83\93\83X\83^\81[\82Ì\8dÅ\91åHP / Extra info captured monster's max HP */
+
+       HIT_PROB to_h;                  /* Plusses to hit */
+       HIT_POINT to_d;                 /* Plusses to damage */
+       ARMOUR_CLASS to_a;                      /* Plusses to AC */
+
+       ARMOUR_CLASS ac;                        /* Normal AC */
+
+       DICE_NUMBER dd;
+       DICE_SID ds;            /* Damage dice/sides */
+
+       TIME_EFFECT timeout;    /* Timeout Counter */
+
+       byte ident;                     /* Special flags  */
+       byte marked;            /* Object is marked */
+
+       u16b inscription;       /* Inscription index */
+       u16b art_name;      /* Artifact name (random artifacts) */
+
+       byte feeling;          /* Game generated inscription number (eg, pseudo-id) */
+
+       BIT_FLAGS art_flags[TR_FLAG_SIZE];        /* Extra Flags for ego and artifacts */
+       BIT_FLAGS curse_flags;        /* Flags for curse */
+
+       OBJECT_IDX next_o_idx;  /* Next object in stack (if any) */
+       MONSTER_IDX held_m_idx; /* Monster holding us (if any) */
+
+       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 */
+};
+
 extern int bow_tval_ammo(object_type *o_ptr);
index e42e43d..070807e 100644 (file)
@@ -47,6 +47,8 @@
 
 #include "h-type.h"
 #include "defines.h"
+#include "object.h"
+
 //#include "player-skill.h"
 
 
@@ -114,93 +116,6 @@ struct mbe_info_type
 
 
 /*
- * Object information, for a specific object.
- *
- * Note that a "discount" on an item is permanent and never goes away.
- *
- * Note that inscriptions are now handled via the "quark_str()" function
- * applied to the "note" field, which will return NULL if "note" is zero.
- *
- * Note that "object" records are "copied" on a fairly regular basis,
- * and care must be taken when handling such objects.
- *
- * Note that "object flags" must now be derived from the object kind,
- * the artifact and ego-item indexes, and the two "xtra" fields.
- *
- * Each grid points to one (or zero) objects via the "o_idx"
- * field (above).  Each object then points to one (or zero) objects
- * via the "next_o_idx" field, forming a singly linked list, which
- * in game terms, represents a "stack" of objects in the same grid.
- *
- * Each monster points to one (or zero) objects via the "hold_o_idx"
- * field (below).  Each object then points to one (or zero) objects
- * via the "next_o_idx" field, forming a singly linked list, which
- * in game terms, represents a pile of objects held by the monster.
- *
- * The "held_m_idx" field is used to indicate which monster, if any,
- * is holding the object.  Objects being held have "ix=0" and "iy=0".
- */
-
-typedef struct object_type object_type;
-
-struct object_type
-{
-       KIND_OBJECT_IDX k_idx;                  /* Kind index (zero if "dead") */
-
-       POSITION iy;                    /* Y-position on map, or zero */
-       POSITION ix;                    /* X-position on map, or zero */
-
-       OBJECT_TYPE_VALUE tval;                 /* Item type (from kind) */
-       OBJECT_SUBTYPE_VALUE sval;                      /* Item sub-type (from kind) */
-
-       PARAMETER_VALUE pval;                   /* Item extra-parameter */
-
-       DISCOUNT_RATE discount;         /* Discount (if any) */
-
-       ITEM_NUMBER number;     /* Number of items */
-
-       WEIGHT weight;          /* Item weight */
-
-       ARTIFACT_IDX name1;             /* Artifact type, if any */
-       EGO_IDX name2;                  /* Ego-Item type, if any */
-
-       XTRA8 xtra1;                    /* Extra info type (now unused) */
-       XTRA8 xtra2;                    /* Extra info activation index */
-       XTRA8 xtra3;                    /* Extra info for weaponsmith */
-       XTRA16 xtra4;                   /*!< 光源の残り寿命、あるいは捕らえたモンスターの現HP / Extra info fuel or captured monster's current HP */
-       XTRA16 xtra5;                   /*!< 捕らえたモンスターの最大HP / Extra info captured monster's max HP */
-
-       HIT_PROB to_h;                  /* Plusses to hit */
-       HIT_POINT to_d;                 /* Plusses to damage */
-       ARMOUR_CLASS to_a;                      /* Plusses to AC */
-
-       ARMOUR_CLASS ac;                        /* Normal AC */
-
-       DICE_NUMBER dd;
-       DICE_SID ds;            /* Damage dice/sides */
-
-       TIME_EFFECT timeout;    /* Timeout Counter */
-
-       byte ident;                     /* Special flags  */
-       byte marked;            /* Object is marked */
-
-       u16b inscription;       /* Inscription index */
-       u16b art_name;      /* Artifact name (random artifacts) */
-
-       byte feeling;          /* Game generated inscription number (eg, pseudo-id) */
-
-       BIT_FLAGS art_flags[TR_FLAG_SIZE];        /* Extra Flags for ego and artifacts */
-       BIT_FLAGS curse_flags;        /* Flags for curse */
-
-       OBJECT_IDX next_o_idx;  /* Next object in stack (if any) */
-       MONSTER_IDX held_m_idx; /* Monster holding us (if any) */
-
-       ARTIFACT_BIAS_IDX artifact_bias; /*!< ランダムアーティファクト生成時のバイアスID */
-};
-
-
-
-/*
  * An entry for the object/monster allocation functions
  *
  * Pass 1 is determined from allocation information