• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisioncb8b09334e3fefb9d6c58bc97cad5bdb6994aa56 (tree)
Time2019-04-25 23:40:53
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 a_info と artifact_type 構造体を artifact.h へ移動。

Change Summary

Incremental Difference

--- a/src/artifact.c
+++ b/src/artifact.c
@@ -25,6 +25,13 @@
2525 #include "spells-object.h"
2626 #include "files.h"
2727
28+ /*
29+ * The artifact arrays
30+ */
31+artifact_type *a_info;
32+char *a_name;
33+char *a_text;
34+
2835 static bool has_extreme_damage_rate(object_type *o_ptr);
2936 static bool weakening_artifact(object_type *o_ptr);
3037
--- a/src/artifact.h
+++ b/src/artifact.h
@@ -1,4 +1,59 @@
1-/* artifact.c */
1+#pragma once
2+
3+
4+typedef struct artifact_type artifact_type;
5+
6+/*!
7+ * @struct artifact_type
8+ * @brief 固定アーティファクト情報の構造体 / Artifact structure.
9+ * @details
10+ * @note
11+ * the save-file only writes "cur_num" to the savefile.
12+ * "max_num" is always "1" (if that artifact "exists")
13+ */
14+struct artifact_type
15+{
16+ STR_OFFSET name; /*!< アーティファクト名(headerオフセット参照) / Name (offset) */
17+ STR_OFFSET text; /*!< アーティファクト解説(headerオフセット参照) / Text (offset) */
18+
19+ OBJECT_TYPE_VALUE tval; /*!< ベースアイテム大項目ID / Artifact type */
20+ OBJECT_SUBTYPE_VALUE sval; /*!< ベースアイテム小項目ID / Artifact sub type */
21+
22+ PARAMETER_VALUE pval; /*!< pval修正値 / Artifact extra info */
23+
24+ HIT_PROB to_h; /*!< 命中ボーナス値 / Bonus to hit */
25+ HIT_POINT to_d; /*!< ダメージボーナス値 / Bonus to damage */
26+ ARMOUR_CLASS to_a; /*!< ACボーナス値 / Bonus to armor */
27+
28+ ARMOUR_CLASS ac; /*!< 上書きベースAC値 / Base armor */
29+
30+ DICE_NUMBER dd;
31+ DICE_SID ds; /*!< ダイス値 / Damage when hits */
32+
33+ WEIGHT weight; /*!< 重量 / Weight */
34+
35+ PRICE cost; /*!< 基本価格 / Artifact "cost" */
36+
37+ BIT_FLAGS flags[TR_FLAG_SIZE]; /*! アイテムフラグ / Artifact Flags */
38+
39+ BIT_FLAGS gen_flags; /*! アイテム生成フラグ / flags for generate */
40+
41+ DEPTH level; /*! 基本生成階 / Artifact level */
42+ RARITY rarity; /*! レアリティ / Artifact rarity */
43+
44+ byte cur_num; /*! 現在の生成数 / Number created (0 or 1) */
45+ byte max_num; /*! (未使用)最大生成数 / Unused (should be "1") */
46+
47+ FLOOR_IDX floor_id; /*! アイテムを落としたフロアのID / Leaved on this location last time */
48+
49+ byte act_idx; /*! 発動能力ID / Activative ability index */
50+};
51+
52+extern artifact_type *a_info;
53+extern char *a_name;
54+extern char *a_text;
55+
56+/* artifact.c */
257 extern bool create_artifact(object_type *o_ptr, bool a_scroll);
358 extern int activation_index(object_type *o_ptr);
459 extern const activation_type* find_activation_info(object_type *o_ptr);
--- a/src/birth.c
+++ b/src/birth.c
@@ -15,6 +15,7 @@
1515 #include "util.h"
1616 #include "bldg.h"
1717
18+#include "artifact.h"
1819 #include "avatar.h"
1920 #include "history.h"
2021 #include "monsterrace-hook.h"
--- a/src/externs.h
+++ b/src/externs.h
@@ -256,9 +256,6 @@ extern char *f_tag;
256256 extern object_kind *k_info;
257257 extern char *k_name;
258258 extern char *k_text;
259-extern artifact_type *a_info;
260-extern char *a_name;
261-extern char *a_text;
262259 extern ego_item_type *e_info;
263260 extern char *e_name;
264261 extern char *e_text;
--- a/src/floor-save.c
+++ b/src/floor-save.c
@@ -13,6 +13,7 @@
1313 #include "angband.h"
1414 #include "util.h"
1515
16+#include "artifact.h"
1617 #include "floor.h"
1718 #include "floor-events.h"
1819 #include "floor-generate.h"
--- a/src/floor-streams.c
+++ b/src/floor-streams.c
@@ -18,6 +18,7 @@
1818 #include "angband.h"
1919 #include "util.h"
2020
21+#include "artifact.h"
2122 #include "floor-generate.h"
2223 #include "floor.h"
2324 #include "floor-streams.h"
--- a/src/init.c
+++ b/src/init.c
@@ -35,6 +35,7 @@
3535 #include "angband.h"
3636 #include "util.h"
3737
38+#include "artifact.h"
3839 #include "init.h"
3940 #include "quest.h"
4041 #include "trap.h"
--- a/src/object-flavor.c
+++ b/src/object-flavor.c
@@ -13,6 +13,7 @@
1313 #include "angband.h"
1414 #include "util.h"
1515
16+#include "artifact.h"
1617 #include "player-status.h"
1718 #include "shoot.h"
1819 #include "object-hook.h"
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -15,6 +15,7 @@
1515 #include "angband.h"
1616 #include "util.h"
1717
18+#include "artifact.h"
1819 #include "floor.h"
1920 #include "bldg.h"
2021 #include "birth.h"
--- a/src/rumor.c
+++ b/src/rumor.c
@@ -3,6 +3,7 @@
33
44 #include "files.h"
55 #include "object-flavor.h"
6+#include "artifact.h"
67
78 /*
89 * Display a rumor and apply its effects
--- a/src/save.c
+++ b/src/save.c
@@ -14,6 +14,7 @@
1414 #include "angband.h"
1515 #include "util.h"
1616
17+#include "artifact.h"
1718 #include "sort.h"
1819 #include "quest.h"
1920 #include "store.h"
--- a/src/sort.c
+++ b/src/sort.c
@@ -2,6 +2,7 @@
22 #include "sort.h"
33 #include "floor.h"
44 #include "quest.h"
5+#include "artifact.h"
56
67 /*
78 * Angband sorting algorithm -- quick sort in place
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -14,6 +14,7 @@
1414 #include "angband.h"
1515 #include "util.h"
1616
17+#include "artifact.h"
1718 #include "cmd-pet.h"
1819 #include "floor.h"
1920 #include "grid.h"
--- a/src/types.h
+++ b/src/types.h
@@ -112,56 +112,6 @@ struct object_kind
112112 };
113113
114114
115-
116-typedef struct artifact_type artifact_type;
117-
118-/*!
119- * @struct artifact_type
120- * @brief 固定アーティファクト情報の構造体 / Artifact structure.
121- * @details
122- * @note
123- * the save-file only writes "cur_num" to the savefile.
124- * "max_num" is always "1" (if that artifact "exists")
125- */
126-struct artifact_type
127-{
128- STR_OFFSET name; /*!< アーティファクト名(headerオフセット参照) / Name (offset) */
129- STR_OFFSET text; /*!< アーティファクト解説(headerオフセット参照) / Text (offset) */
130-
131- OBJECT_TYPE_VALUE tval; /*!< ベースアイテム大項目ID / Artifact type */
132- OBJECT_SUBTYPE_VALUE sval; /*!< ベースアイテム小項目ID / Artifact sub type */
133-
134- PARAMETER_VALUE pval; /*!< pval修正値 / Artifact extra info */
135-
136- HIT_PROB to_h; /*!< 命中ボーナス値 / Bonus to hit */
137- HIT_POINT to_d; /*!< ダメージボーナス値 / Bonus to damage */
138- ARMOUR_CLASS to_a; /*!< ACボーナス値 / Bonus to armor */
139-
140- ARMOUR_CLASS ac; /*!< 上書きベースAC値 / Base armor */
141-
142- DICE_NUMBER dd;
143- DICE_SID ds; /*!< ダイス値 / Damage when hits */
144-
145- WEIGHT weight; /*!< 重量 / Weight */
146-
147- PRICE cost; /*!< 基本価格 / Artifact "cost" */
148-
149- BIT_FLAGS flags[TR_FLAG_SIZE]; /*! アイテムフラグ / Artifact Flags */
150-
151- BIT_FLAGS gen_flags; /*! アイテム生成フラグ / flags for generate */
152-
153- DEPTH level; /*! 基本生成階 / Artifact level */
154- RARITY rarity; /*! レアリティ / Artifact rarity */
155-
156- byte cur_num; /*! 現在の生成数 / Number created (0 or 1) */
157- byte max_num; /*! (未使用)最大生成数 / Unused (should be "1") */
158-
159- FLOOR_IDX floor_id; /*! アイテムを落としたフロアのID / Leaved on this location last time */
160-
161- byte act_idx; /*! 発動能力ID / Activative ability index */
162-};
163-
164-
165115 /*
166116 * Information about "ego-items".
167117 */
--- a/src/variable.c
+++ b/src/variable.c
@@ -565,13 +565,6 @@ char *k_name;
565565 char *k_text;
566566
567567 /*
568- * The artifact arrays
569- */
570-artifact_type *a_info;
571-char *a_name;
572-char *a_text;
573-
574-/*
575568 * The ego-item arrays
576569 */
577570 ego_item_type *e_info;
--- a/src/wizard1.c
+++ b/src/wizard1.c
@@ -13,6 +13,7 @@
1313 #include "angband.h"
1414 #include "util.h"
1515
16+#include "artifact.h"
1617 #include "sort.h"
1718 #include "store.h"
1819 #include "monster.h"
Show on old repository browser