Hengband  2.2.1
artifact.h
[詳解]
1 #pragma once
2 #include "cmd-activate.h"
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  */
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 
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  #define TRG_INSTA_ART 0x00000001L /* Item must be an artifact */
40  #define TRG_QUESTITEM 0x00000002L /* quest level item -KMW- */
41  #define TRG_XTRA_POWER 0x00000004L /* Extra power */
42  #define TRG_ONE_SUSTAIN 0x00000008L /* One sustain */
43  #define TRG_XTRA_RES_OR_POWER 0x00000010L /* Extra resistance or power */
44  #define TRG_XTRA_H_RES 0x00000020L /* Extra high resistance */
45  #define TRG_XTRA_E_RES 0x00000040L /* Extra element resistance */
46  #define TRG_XTRA_L_RES 0x00000080L /* Extra lordly resistance */
47  #define TRG_XTRA_D_RES 0x00000100L /* Extra dragon resistance */
48  #define TRG_XTRA_RES 0x00000200L /* Extra resistance */
49  #define TRG_CURSED 0x00000400L /* Item is Cursed */
50  #define TRG_HEAVY_CURSE 0x00000800L /* Item is Heavily Cursed */
51  #define TRG_PERMA_CURSE 0x00001000L /* Item is Perma Cursed */
52  #define TRG_RANDOM_CURSE0 0x00002000L /* Item is Random Cursed */
53  #define TRG_RANDOM_CURSE1 0x00004000L /* Item is Random Cursed */
54  #define TRG_RANDOM_CURSE2 0x00008000L /* Item is Random Cursed */
55  #define TRG_XTRA_DICE 0x00010000L /* Extra dice */
56  #define TRG_POWERFUL 0x00020000L /* Item has good value even if Cursed */
57  BIT_FLAGS gen_flags; /*! アイテム生成フラグ / flags for generate */
58 
59  DEPTH level; /*! 基本生成階 / Artifact level */
60  RARITY rarity; /*! レアリティ / Artifact rarity */
61 
62  byte cur_num; /*! 現在の生成数 / Number created (0 or 1) */
63  byte max_num; /*! (未使用)最大生成数 / Unused (should be "1") */
64 
65  FLOOR_IDX floor_id; /*! アイテムを落としたフロアのID / Leaved on this location last time */
66 
67  byte act_idx; /*! 発動能力ID / Activative ability index */
68 };
69 
70 extern artifact_type *a_info;
71 extern char *a_name;
72 extern char *a_text;
73 
74 extern ARTIFACT_IDX max_a_idx;
75 
76 /* artifact.c */
77 extern bool become_random_artifact(object_type *o_ptr, bool a_scroll);
78 extern int activation_index(object_type *o_ptr);
79 extern const activation_type* find_activation_info(object_type *o_ptr);
80 extern void random_artifact_resistance(object_type * o_ptr, artifact_type *a_ptr);
81 extern bool create_named_art(ARTIFACT_IDX a_idx, POSITION y, POSITION x);
82 extern bool make_artifact(object_type *o_ptr);
83 extern bool make_artifact_special(object_type *o_ptr);
84 
85 /*** Artifact indexes (see "lib/edit/a_info.txt") ***/
86 
87 /* Lites */
88 #define ART_GALADRIEL 1
89 #define ART_ELENDIL 2
90 #define ART_JUDGE 3
91 #define ART_EDISON 7
92 #define ART_PALANTIR 15
93 #define ART_STONE_LORE 17
94 #define ART_FLY_STONE 147
95 #define ART_ORB_OF_FATE 245
96 /* Amulets */
97 #define ART_CARLAMMAS 4
98 #define ART_INGWE 5
99 #define ART_DWARVES 6
100 #define ART_FARAMIR 18
101 #define ART_BOROMIR 143
102 #define ART_MAGATAMA 149
103 #define ART_INROU 166
104 #define ART_NIGHT 215
105 #define ART_SACRED_KNIGHTS 217
106 #define ART_HELL 218
107 #define ART_CHARMED 219
108 #define ART_GOGO 220
109 
110 /* Rings */
111 #define ART_FRAKIR 8
112 #define ART_TULKAS 9
113 #define ART_NARYA 10
114 #define ART_NENYA 11
115 #define ART_VILYA 12
116 #define ART_POWER 13
117 #define ART_AHO 14
118 
119 /* Dragon Scale */
120 #define ART_RAZORBACK 129
121 #define ART_BLADETURNER 130
122 #define ART_SEIRYU 201
123 
124 /* Hard Armour */
125 #define ART_SOULKEEPER 19
126 #define ART_ISILDUR 20
127 #define ART_ROHIRRIM 21
128 #define ART_LOHENGRIN 22
129 #define ART_JULIAN 23
130 #define ART_ARVEDUI 24
131 #define ART_CASPANION 25
132 #define ART_GILES 168
133 #define ART_MORLOK 203
134 #define ART_VETERAN 206
135 
136 /* Soft Armour */
137 #define ART_SHIVA_JACKET 26
138 #define ART_HITHLOMIR 27
139 #define ART_THALKETTOTH 28
140 #define ART_HIMRING 127
141 #define ART_ICANUS 131
142 #define ART_NAMAKE_ARMOR 183
143 #define ART_GHB 192
144 #define ART_DASAI 200
145 #define ART_KESHO 204
146 #define ART_MILIM 246
147 
148 /* Shields */
149 #define ART_THORIN 30
150 #define ART_CELEGORM 31
151 #define ART_ANARION 32
152 #define ART_GIL_GALAD 138
153 #define ART_YENDOR 141
154 #define ART_YATA 151
155 #define ART_EARENDIL 186
156 #define ART_PERSEUS 197
157 
158 /* Helms and Crowns */
159 #define ART_INDRA 33
160 #define ART_CHAOS 34
161 #define ART_BERUTHIEL 35
162 #define ART_THRANDUIL 36
163 #define ART_THENGEL 37
164 #define ART_HAMMERHAND 38
165 #define ART_DOR 39
166 #define ART_HOLHENNETH 40
167 #define ART_TERROR 41
168 #define ART_AMBER 42
169 #define ART_NUMENOR 132
170 #define ART_STONEMASK 146
171 
172 /* Cloaks */
173 #define ART_JACK 43
174 #define ART_COLLUIN 44
175 #define ART_HOLCOLLETH 45
176 #define ART_THINGOL 46
177 #define ART_THORONGIL 47
178 #define ART_COLANNON 48
179 #define ART_LUTHIEN 49
180 #define ART_TUOR 50
181 #define ART_MOOK 205
182 #define ART_HEAVENLY_MAIDEN 233
183 
184 /* Gloves */
185 #define ART_CAMBELEG 52
186 #define ART_CAMMITHRIM 53
187 #define ART_PAURHACH 54
188 #define ART_CORWIN 55
189 #define ART_PAURAEGEN 56
190 #define ART_PAURNEN 57
191 #define ART_THANOS 58
192 #define ART_FINGOLFIN 59
193 #define ART_PAURNIMMEN 185
194 
195 /* Boots */
196 #define ART_FEANOR 60
197 #define ART_FLORA 61
198 #define ART_THROR 62
199 #define ART_SHIVA_BOOTS 63
200 #define ART_GLASS 165
201 #define ART_GETA 210
202 
203 /* Digging */
204 #define ART_NAIN 211
205 
206 /* Swords */
207 #define ART_MAEDHROS 64
208 #define ART_CAINE 65
209 #define ART_NARTHANC 66
210 #define ART_NIMTHANC 67
211 #define ART_DETHANC 68
212 #define ART_RILIA 69
213 #define ART_FIONA 70
214 #define ART_CALRIS 71
215 #define ART_GRAYSWANDIR 72
216 #define ART_GLAMDRING 73
217 #define ART_NOTHUNG 74
218 #define ART_ORCRIST 75
219 #define ART_GURTHANG 76
220 #define ART_ZARCUTHRA 77
221 #define ART_TWILIGHT 78
222 #define ART_GONDRICAM 79
223 #define ART_CRISDURIAN 80
224 #define ART_AGLARANG 81
225 #define ART_RINGIL 82
226 #define ART_ANDURIL 83
227 #define ART_WEREWINDLE 84
228 #define ART_CHAINSWORD 85
229 #define ART_FORASGIL 86
230 #define ART_CARETH 87
231 #define ART_STING 88
232 #define ART_SOULSWORD 89
233 #define ART_MERLIN 90
234 #define ART_DOOMCALLER 91
235 #define ART_VORPAL_BLADE 92
236 #define ART_SLAYER 123
237 #define ART_KUSANAGI 128
238 #define ART_HURIN 133
239 #define ART_AZAGHAL 135
240 #define ART_NOVA 137
241 #define ART_CHARIOT 140
242 #define ART_WORPAL_BLADE 142
243 #define ART_MURAMASA 144
244 #define ART_ZANTETSU 150
245 #define ART_SOULCRUSH 154
246 #define ART_FALIS 155
247 #define ART_HRUNTING 156
248 #define ART_ANUBIS 158
249 #define ART_GURENKI 160
250 #define ART_TAILBITER 167
251 #define ART_MUSASI_KATANA 171
252 #define ART_MUSASI_WAKIZASI 172
253 #define ART_QUICKTHORN 174
254 #define ART_TINYTHORN 175
255 #define ART_EXCALIBUR 176
256 #define ART_EXCALIPUR 177
257 #define ART_EXCALIBUR_J 179
258 #define ART_ARUNRUTH 184
259 #define ART_HAKABUSA 189
260 #define ART_STORMBRINGER 190
261 #define ART_NARSIL 191
262 #define ART_KANNU 193
263 #define ART_GRIMTOOTH 196
264 #define ART_KAMUI 198
265 #define ART_GOURYU 207
266 #define ART_EOWYN 216
267 #define ART_NANACHO 248
268 #define ART_ROBINTON 251
269 
270 /* Polearms */
271 #define ART_THEODEN 93
272 #define ART_PAIN 94
273 #define ART_OSONDIR 95
274 #define ART_TIL 96
275 #define ART_RUNESPEAR 97
276 #define ART_DESTINY 98
277 #define ART_HAGEN 99
278 #define ART_EORLINGAS 100
279 #define ART_DURIN 101
280 #define ART_EONWE 102
281 #define ART_BALLI 103
282 #define ART_LOTHARANG 104
283 #define ART_DWARVES_AXE 105
284 #define ART_BARUKKHELED 106
285 #define ART_WRATH 107
286 #define ART_ULMO 108
287 #define ART_AVAVIR 109
288 #define ART_BENKEI 152
289 #define ART_TAIKOBO 159
290 #define ART_TONBO 161
291 #define ART_GAEBOLG 163
292 #define ART_ARRYU 164
293 #define ART_AEGLOS 187
294 #define ART_BLOOD 199
295 #define ART_NUMAHOKO 202
296 
297 /* The sword of the Dawn */
298 #define ART_DAWN 110
299 
300 /* Hafted */
301 #define ART_GROND 111
302 #define ART_TOTILA 112
303 #define ART_THUNDERFIST 113
304 #define ART_BLOODSPIKE 114
305 #define ART_FIRESTAR 115
306 #define ART_TARATOL 116
307 #define ART_AULE 117
308 #define ART_NAR 118
309 #define ART_ERIRIL 119
310 #define ART_GANDALF 120
311 #define ART_DEATHWREAKER 121
312 #define ART_TURMIL 122
313 #define ART_MJOLLNIR 136
314 #define ART_WINBLOWS 139
315 #define ART_XIAOLONG 145
316 #define ART_NYOIBOU 157
317 #define ART_JONES 162
318 #define ART_HYOUSIGI 169
319 #define ART_MATOI 170
320 #define ART_IRON_BALL 173
321 #define ART_SAMSON 178
322 #define ART_NAMAKE_HAMMER 181
323 #define ART_BOLISHOI 188
324 #define ART_SHUTEN_DOJI 194
325 #define ART_G_HAMMER 195
326 #define ART_AEGISFANG 208
327 #define ART_HERMIT 209
328 #define ART_GOTHMOG 212
329 #define ART_JIZO 213
330 #define ART_FUNDIN 214
331 #define ART_AESCULAPIUS 225
332 
333 /* Bows */
334 #define ART_BELTHRONDING 124
335 #define ART_BARD 125
336 #define ART_BRAND 126
337 #define ART_CRIMSON 16
338 #define ART_BUCKLAND 134
339 #define ART_YOICHI 148
340 #define ART_HARAD 180
341 #define ART_NAMAKE_BOW 182
342 #define ART_ROBIN_HOOD 221
343 #define ART_HELLFIRE 222
344 
345 /* Arrows */
346 #define ART_BARD_ARROW 153
347 
348 
349 /* "Biases" for random artifact gen */
350 #define BIAS_ELEC 1 /*!< ランダムアーティファクトバイアス:電撃 */
351 #define BIAS_POIS 2 /*!< ランダムアーティファクトバイアス:毒 */
352 #define BIAS_FIRE 3 /*!< ランダムアーティファクトバイアス:火炎 */
353 #define BIAS_COLD 4 /*!< ランダムアーティファクトバイアス:冷気 */
354 #define BIAS_ACID 5 /*!< ランダムアーティファクトバイアス:酸 */
355 #define BIAS_STR 6 /*!< ランダムアーティファクトバイアス:腕力 */
356 #define BIAS_INT 7 /*!< ランダムアーティファクトバイアス:知力 */
357 #define BIAS_WIS 8 /*!< ランダムアーティファクトバイアス:賢さ */
358 #define BIAS_DEX 9 /*!< ランダムアーティファクトバイアス:器用さ */
359 #define BIAS_CON 10 /*!< ランダムアーティファクトバイアス:耐久 */
360 #define BIAS_CHR 11 /*!< ランダムアーティファクトバイアス:魅力 */
361 #define BIAS_CHAOS 12 /*!< ランダムアーティファクトバイアス:混沌 */
362 #define BIAS_PRIESTLY 13 /*!< ランダムアーティファクトバイアス:プリースト系 */
363 #define BIAS_NECROMANTIC 14 /*!< ランダムアーティファクトバイアス:死霊 */
364 #define BIAS_LAW 15 /*!< ランダムアーティファクトバイアス:法 */
365 #define BIAS_ROGUE 16 /*!< ランダムアーティファクトバイアス:盗賊系 */
366 #define BIAS_MAGE 17 /*!< ランダムアーティファクトバイアス:メイジ系 */
367 #define BIAS_WARRIOR 18 /*!< ランダムアーティファクトバイアス:戦士系 */
368 #define BIAS_RANGER 19 /*!< ランダムアーティファクトバイアス:レンジャー系 */
369 #define MAX_BIAS 20 /*!< ランダムアーティファクトバイアス:最大数 */
int activation_index(object_type *o_ptr)
オブジェクトから能力発動IDを取得する。
Definition: artifact.c:1880
const activation_type * find_activation_info(object_type *o_ptr)
オブジェクトから発動効果構造体のポインタを取得する。
Definition: artifact.c:1926
WEIGHT weight
重量 / Weight
Definition: artifact.h:33
STR_OFFSET name
アーティファクト名(headerオフセット参照) / Name (offset)
Definition: artifact.h:16
BIT_FLAGS flags[TR_FLAG_SIZE]
Definition: artifact.h:37
ARTIFACT_IDX max_a_idx
Definition: artifact.c:48
BIT_FLAGS gen_flags
Definition: artifact.h:57
char * a_text
Definition: artifact.c:43
bool create_named_art(ARTIFACT_IDX a_idx, POSITION y, POSITION x)
フロアの指定された位置に固定アーティファクトを生成する。 / Create the artifact of the specified number
Definition: artifact.c:2056
Definition: object.h:189
s32b WEIGHT
ゲーム中の重量の型定義(ポンド)
Definition: h-type.h:205
void random_artifact_resistance(object_type *o_ptr, artifact_type *a_ptr)
固定アーティファクト生成時の特別なハードコーディング処理を行う。.
Definition: artifact.c:1952
OBJECT_TYPE_VALUE tval
ベースアイテム大項目ID / Artifact type
Definition: artifact.h:19
PARAMETER_VALUE pval
pval修正値 / Artifact extra info
Definition: artifact.h:22
OBJECT_SUBTYPE_VALUE sval
ベースアイテム小項目ID / Artifact sub type
Definition: artifact.h:20
int DICE_NUMBER
ゲーム中のダイス数の型定義
Definition: h-type.h:207
byte cur_num
レアリティ / Artifact rarity
Definition: artifact.h:62
ARMOUR_CLASS to_a
ACボーナス値 / Bonus to armor
Definition: artifact.h:26
#define TR_FLAG_SIZE
Definition: object.h:175
s32b DEPTH
ゲーム中の階層レベルの型定義
Definition: h-type.h:216
STR_OFFSET text
アーティファクト解説(headerオフセット参照) / Text (offset)
Definition: artifact.h:17
artifact_type * a_info
Definition: artifact.c:41
s32b HIT_POINT
HPとその増減量の型定義
Definition: h-type.h:161
u32b BIT_FLAGS
32ビットのフラグ配列の型定義
Definition: h-type.h:225
s16b FLOOR_IDX
ゲーム中のフロアID型を定義
Definition: h-type.h:116
ARMOUR_CLASS ac
上書きベースAC値 / Base armor
Definition: artifact.h:28
s32b POSITION
ゲーム中の座標型を定義
Definition: h-type.h:146
DICE_NUMBER dd
Definition: artifact.h:30
HIT_PROB to_h
命中ボーナス値 / Bonus to hit
Definition: artifact.h:24
s32b OBJECT_SUBTYPE_VALUE
ゲーム中のアイテム副分類の型定義
Definition: h-type.h:203
s32b OBJECT_TYPE_VALUE
ゲーム中のアイテム主分類の型定義
Definition: h-type.h:202
u32b STR_OFFSET
テキストオフセットの型定義
Definition: h-type.h:212
s16b PARAMETER_VALUE
ゲーム中のアイテム能力値の型定義
Definition: h-type.h:204
bool make_artifact(object_type *o_ptr)
非INSTA_ART型の固定アーティファクトの生成を確率に応じて試行する。 Mega-Hack – Attempt to create one of the "Special Objects"
Definition: artifact.c:2232
byte max_num
現在の生成数 / Number created (0 or 1)
Definition: artifact.h:63
PRICE cost
基本価格 / Artifact "cost"
Definition: artifact.h:35
bool become_random_artifact(object_type *o_ptr, bool a_scroll)
ランダムアーティファクト生成のメインルーチン
Definition: artifact.c:1552
固定アーティファクト情報の構造体 / Artifact structure.
Definition: artifact.h:14
FLOOR_IDX floor_id
(未使用)最大生成数 / Unused (should be "1")
Definition: artifact.h:65
s16b ARTIFACT_IDX
ゲーム中のアーティファクトID型を定義
Definition: h-type.h:132
s32b PRICE
ゲーム中の金額価値の型定義
Definition: h-type.h:209
byte act_idx
アイテムを落としたフロアのID / Leaved on this location last time
Definition: artifact.h:67
bool make_artifact_special(object_type *o_ptr)
INSTA_ART型の固定アーティファクトの生成を確率に応じて試行する。 Mega-Hack – Attempt to create one of the "Special Objects"
Definition: artifact.c:2299
DICE_SID ds
ダイス値 / Damage when hits
Definition: artifact.h:31
int DICE_SID
ゲーム中のダイス面の型定義
Definition: h-type.h:208
DEPTH level
アイテム生成フラグ / flags for generate
Definition: artifact.h:59
char * a_name
Definition: artifact.c:42
s16b HIT_PROB
ゲーム中の装備命中修正値を定義
Definition: h-type.h:173
s16b ARMOUR_CLASS
ゲーム中の行動アーマークラス型を定義
Definition: h-type.h:181
HIT_POINT to_d
ダメージボーナス値 / Bonus to damage
Definition: artifact.h:25
RARITY rarity
基本生成階 / Artifact level
Definition: artifact.h:60
byte RARITY
ゲーム中の希少度の型定義
Definition: h-type.h:217