OSDN Git Service

[Refactor] #40561 Separated random-art-generator.c/h from artifact.c/h
[hengband/hengband.git] / src / object-enchant / artifact.h
1 #pragma once
2
3 #include "system/angband.h"
4 #include "cmd-item/cmd-activate.h"
5 #include "object-enchant/activation-info-table.h"
6 #include "system/object-type-definition.h"
7
8 /*!
9  * @struct artifact_type
10  * @brief 固定アーティファクト情報の構造体 / Artifact structure.
11  * @details
12  * @note
13  * the save-file only writes "cur_num" to the savefile.
14  * "max_num" is always "1" (if that artifact "exists")
15  */
16 typedef struct artifact_type {
17         STR_OFFSET name;                        /*!< アーティファクト名(headerオフセット参照) / Name (offset) */
18         STR_OFFSET text;                        /*!< アーティファクト解説(headerオフセット参照) / Text (offset) */
19         tval_type tval;         /*!< ベースアイテム大項目ID / Artifact type */
20         OBJECT_SUBTYPE_VALUE sval;      /*!< ベースアイテム小項目ID / Artifact sub type */
21         PARAMETER_VALUE pval;   /*!< pval修正値 / Artifact extra info */
22         HIT_PROB to_h;                  /*!< 命中ボーナス値 /  Bonus to hit */
23         HIT_POINT to_d;         /*!< ダメージボーナス値 / Bonus to damage */
24         ARMOUR_CLASS to_a;                      /*!< ACボーナス値 / Bonus to armor */
25         ARMOUR_CLASS ac;                        /*!< 上書きベースAC値 / Base armor */
26         DICE_NUMBER dd;
27         DICE_SID ds;    /*!< ダイス値 / Damage when hits */
28         WEIGHT weight;          /*!< 重量 / Weight */
29         PRICE cost;                     /*!< 基本価格 / Artifact "cost" */
30         BIT_FLAGS flags[TR_FLAG_SIZE];       /*! アイテムフラグ / Artifact Flags */
31         BIT_FLAGS gen_flags;            /*! アイテム生成フラグ / flags for generate */
32         DEPTH level;            /*! 基本生成階 / Artifact level */
33         RARITY rarity;          /*! レアリティ / Artifact rarity */
34         byte cur_num;           /*! 現在の生成数 / Number created (0 or 1) */
35         byte max_num;           /*! (未使用)最大生成数 / Unused (should be "1") */
36         FLOOR_IDX floor_id;      /*! アイテムを落としたフロアのID / Leaved on this location last time */
37         byte act_idx;           /*! 発動能力ID / Activative ability index */
38 } artifact_type;
39
40 extern artifact_type *a_info;
41 extern char *a_name;
42 extern char *a_text;
43 extern ARTIFACT_IDX max_a_idx;
44
45 int activation_index(player_type *player_ptr, object_type *o_ptr);
46 const activation_type *find_activation_info(player_type *player_ptr, object_type *o_ptr);
47 void random_artifact_resistance(player_type *player_ptr, object_type *o_ptr, artifact_type *a_ptr);
48 bool create_named_art(player_type *player_ptr, ARTIFACT_IDX a_idx, POSITION y, POSITION x);
49 bool make_artifact(player_type *player_ptr, object_type *o_ptr);
50 bool make_artifact_special(player_type *player_ptr, object_type *o_ptr);